Michael Nischt
10-05-2010, 10:17 AM
Hi all,
I wonder if it is possible to use a texture as depth-buffer while rendering to the default framebuffer (GL_BACK)?
My problem is that I have a deferred rendering architecture and want to draw (semi-)transparent objects in a forward rendering pass on top.
Currently, I am rendering the opaque objects again with a glColorMask in the final forward pass. However, I already have the nearest depth values already in a texture.
An improvment is to render a fullscreen quad with the depth-texture and write the values to gl_FragDepth. Yet, I hope there is a better solution by simple 'attaching' the depth-texture to the default framebuffer. Is there one?
Thanks and best regards,
Michael
I wonder if it is possible to use a texture as depth-buffer while rendering to the default framebuffer (GL_BACK)?
My problem is that I have a deferred rendering architecture and want to draw (semi-)transparent objects in a forward rendering pass on top.
Currently, I am rendering the opaque objects again with a glColorMask in the final forward pass. However, I already have the nearest depth values already in a texture.
An improvment is to render a fullscreen quad with the depth-texture and write the values to gl_FragDepth. Yet, I hope there is a better solution by simple 'attaching' the depth-texture to the default framebuffer. Is there one?
Thanks and best regards,
Michael