How to perform depth test in pixel shader

Started by
10 comments, last by parmar 14 years, 7 months ago
// fragment shader //

eg

gl_FragDepth = gl_FragCoord.z;

glDepthFunc( GL_XXXXX ); passes or fails
depending on what curent depthvalue compared to FragDepth
Advertisement

Thanks every one for replying,
Hi zedz,

In my pixel shader i tried to do gl_FragCoord.z<0.1
then only i am writing to gl_FragColor.
Then i am missing all material color and getting
some yellow color with flickring triangle for my
Collada car model.Actually it should discard some part
of my car model.
Regards,
Parmar.






This topic is closed to new replies.

Advertisement