File: indicator.fs

package info (click to toggle)
pymol 2.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,312 kB
  • sloc: cpp: 480,106; python: 79,860; ansic: 28,343; javascript: 6,792; sh: 47; makefile: 30; csh: 8
file content (32 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (3)
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
#include webgl_header.fs

#ifdef PYMOL_WEBGL_IOS
precision highp float;
#else
#version 120
#endif

uniform sampler2D textureMap;
uniform vec2 textureLookup ;
uniform vec2 textureScale ;
uniform float g_pointSize;
uniform vec4 viewport;

#include anaglyph_header.fs

varying vec4 POS;

/*
* On graphics drivers which are not buggy, this should be
* equivalent to gl_PointCoord.
*/
vec2 get_pointcoord() {
 vec2 p = viewport.xy + 0.5 * (POS.xy / POS.w + 1.0) * viewport.zw;
 return (gl_FragCoord.xy - p) / g_pointSize + 0.5;
}

void main()
{
 gl_FragColor = texture2D(textureMap, textureLookup + get_pointcoord() * textureScale);
 PostLightingEffects();
}