varying float depth; uniform float pos; uniform float thres; void main (void) { vec4 color = gl_Color; //color.r = cos(depth); //color.g = cos(depth+3.14*2.*0.333); //color.b = cos(depth+3.14*2.*0.666); if (depth<=pos+thres/2 && depth > pos -thres/2) { color.a = 1;} else {color.a=0; color.r=0;} gl_FragColor = color; }