File: oit.fs

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (32 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef PYMOL_WEBGL
#version 120
#else
precision highp float;
#endif

uniform sampler2D accumTex;
uniform sampler2D revealageTex;
uniform float isRight;

varying vec2 texcoordAttr;

#define texture texture2D

void main()
{
        vec4 accum = texture(accumTex, texcoordAttr).rgba;
        float r = accum.a;
#ifdef ANAGLYPH
        // need to set two components because anaglyph masks out colors for each eye
#ifdef GLEW_VERSION_3_0
        accum.a = texture(revealageTex, texcoordAttr).r;
#else
        vec2 sum = texture(revealageTex, texcoordAttr).rg;
        accum.a = (1.-isRight) * sum.x + isRight * sum.y;
#endif

#else
        accum.a = texture(revealageTex, texcoordAttr).r;
#endif
	gl_FragColor = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
}