Let’s say I want to render_to_texture and I only care for the color texture. I can share a depth render buffer between my FBOs, right?
IIRC, the render buffer must be the same size as the color texture. This hasn’t changed yet?
What if I do
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboID1);
//some other setup code go here
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBufferID);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboID2);
//some other setup code go here
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBufferID);
Does this mean the depth render buffer is now bound to 2 FBOs?
I found the bug. The texture was not init at times due to my complex code.
By init, I mean glTexImage2D wasn’t beeing called for the correct texture because glBindTexture needed a recall.