varying float depth; varying float XYlimit; 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.0 && depth > pos -thres/2.0) && depth > -1.0) { color.a = 1.0;} else {color.a=0.0;} //color.a *= XYlimit; gl_FragColor = color; }