Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Your Answer


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

Browse other questions tagged or ask your own question.