Depth buffer values reset on change shader?

Posted by bobobobo on Game Development See other posts from Game Development or by bobobobo
Published on 2012-09-30T22:26:34Z Indexed on 2012/10/01 3:52 UTC
Read the original article Hit count: 265

Filed under:
|
|

I have 2 different shaders, and when I change the shader (glUseProgram), it seems that the depth information is lost, because everything drawn with the 2nd shader appears completely on top of anything drawn by the first shader.

If I switch the order of shader use/drawing, then it's the same (the last drawn object always appears on top of the first drawn object if there is a shader change between the 2 objects, even if the last drawn object is further away)

© Game Development or respective owner

Related posts about shaders

Related posts about glsl