Write into multi depth buffer

Started by
10 comments, last by zenux 11 years, 11 months ago

* I have already several depth buffers (see my first post).

Anything you had attached to GL_COLOR_ATTACHMENTi are used for your purposes (but for OpenGL they are notified as color buffer) and they are not reacting with depth buffer...

* What OpenGL will write in GL_DEPTH_ATTACHMENT ? A common depth buffer will be wrote for all vertex emitted by the geometry shader ?

If your FBO doesn't have something attached into GL_DEPTH_ATTACHMENT OpenGL can't do any operations with depth buffer because it doesn't exist. A common (screen) depth buffer will not be touched till you are working with your FBO.

So, you need to attach something into GL_DEPTH_ATTACHMENT (texture or render buffer) and do it (what you want) in multi-pass or...
you can attach large depth texture (internal format: GL_DEPTH_COMPONENT) which would contain a couple of textures (which you planned to make them with separated "depth" textures):
+---+
|012|
|345|
+---+
each number - area of depth buffer which is used for something, for your purposes (in fragment shader you need to do custom clipping).

Best wishes, FXACE.
Advertisement
Ok, thank you.
I've just seen that it's maybe possible to have something better with texture 2d array and gl_Layer. I will try it.

This topic is closed to new replies.

Advertisement