PDA

View Full Version : Depth texture and FBO



V-man
01-01-2009, 12:16 PM
Let's say I want to render to the FBO that only has a depth texture attached. When I normally check the status of the FBO, I get some error message that I forgot to write down. I have to call glDrawBuffer(GL_NONE) for check FBO status to return OK. Is that correct?
I was able to render to the FBO later in my code and it works.
I'm on an nvidia right now so I don't know if ATI has sone other behavior.
What is the officially correct way to do this?

HellRaiZer
01-01-2009, 12:40 PM
From the specs:

The intial value of DRAW_BUFFER for application-created framebuffer objects is COLOR_ATTACHMENT0_EXT.


Since your color attachment isn't valid, the fbo shouldn't be complete, unless you specify NONE as the draw buffer.

So i guess this is the correct/official way of doing it.

EDIT : Also check example 7 in the specs

V-man
01-02-2009, 04:22 PM
Thanks, it's all good.