PDA

View Full Version : Questions about FBOs



Arkion
08-13-2005, 05:35 AM
Hi

I have couple of questions about FBOs and GL functions related to the framebuffer:

* Am I to understand that glCopyTex(Sub)Image2D() determines what kind of image info (color, depth or stencil bits) it's to copy based on internal format of the currently bound texture? Ie. if internal format of the texture is GL_DEPTH_COMPONENT it copies depth buffer bits, if GL_RGB it's the color buffer, etc.

* Isn't it possible to render directly to a depth texture using ATI 3D card and current drivers? Attaching a depth texture like so:


gle.glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, pl->DepthTex(), 0);This causes CheckFramebufferStatus to return GL_FRAMEBUFFER_INCOMPLETE_* status. I have ATI Radeon 9700 with newest drivers.

Java Cool Dude
08-13-2005, 08:01 AM
Add these two lines:
glReadBuffer(GL_NONE);
glDrawBuffer(GL_NONE);

In the current state of ATI's official drivers, you can only attach a 16 bit DEPTH texture.
Hope that helps

Arkion
08-13-2005, 10:55 AM
In the current state of ATI's official drivers, you can only attach a 16 bit DEPTH texture. Great, thanks for the info! I got it working with 16-bit depth. Directly rendering to the texture also fixed the slight problem I was having with glCopyTexSubImage2D - part of the shadow map texture wasn't updated (as if glViewport was too small, although it was of correct size).