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 was wondering if it is possible to render my scene onto a depth texture then using that texture for depth testing in another pass. I have an idea to that in shaders, but is that possible hardware-side?

share|improve this question

1 Answer 1

One way to accomplish this would be to use an FBO (Frame Buffer Object) and multiple depth buffers and/or depth textures. A basic use case is shown on the Wiki at OpenGL.org.


Another possible method, maybe applicable to old or very low end hardware could be copying the depth buffer, which you can find an example of using PBOs (Pixel Buffer Objects) here.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.