UNPKG

322 BPlain TextView Raw
1uniform sampler2D u_image;
2uniform sampler2D u_color_ramp;
3uniform float u_opacity;
4varying vec2 v_pos;
5
6void main() {
7 float t = texture2D(u_image, v_pos).r;
8 vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));
9 gl_FragColor = color * u_opacity;
10
11#ifdef OVERDRAW_INSPECTOR
12 gl_FragColor = vec4(0.0);
13#endif
14}