Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to render a scene with an outline post processing effect in OpenGL ES 2.0.

First I render all the opaque objects. Then I use a post processing shader for silhouette detection that uses the depth buffer as a texture. And now I want to render all the objects using alpha blending, without writing to the depth buffer, but using depth testing with the values from the depth buffer texture used for silhouette detection.

If I would have rendered the translucent objects before the post processing, the post processing would have rendered the outlines of opaque objects over them since they don't write to the depth buffer.

How do you tell OpenGL ES 2.0 to use a texture as the depth buffer?

Thank you

share|improve this question
    
If you want OpenGL to use an arbitrary texture for the depth buffer, this will be extremely difficult. However, if you use two FBOs each of which share the same depth attachment you are good to go. –  Andon M. Coleman Sep 9 '13 at 0:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.