copie de kinectLike.frag 333 B

12345678910111213141516171819
  1. varying float depth;
  2. uniform float pos;
  3. uniform float thres;
  4. void main (void)
  5. {
  6. vec4 color = gl_Color;
  7. //color.r = cos(depth);
  8. //color.g = cos(depth+3.14*2.*0.333);
  9. //color.b = cos(depth+3.14*2.*0.666);
  10. if (depth<=pos+thres/2 && depth > pos -thres/2)
  11. { color.a = 1;}
  12. else {color.a=0;
  13. color.r=0;}
  14. gl_FragColor = color;
  15. }