Qt-interest Archive, August 2007
QGLFramebufferObject with GL_DEPTH_COMPONENT in Qt 4.3.0
Message 1 in thread
Hi,
I'm trying to use the QGLFramebufferObject class to do projective
shadow mapping, which means I would like to bind the depth component
of a rendered scene as a texture. Is there any way to do this? I find
that if I just set the internal format to GL_DEPTH_COMPONENT I get
the following error:
[qglframebufferobject.cpp line 141] GL Error: 1282
QGLFramebufferObject: Framebuffer incomplete attachment.
QGLFramebufferObject: Framebuffer incomplete attachment.
From what I can tell this is because on line 138 of
qglframebufferobject.cpp:
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
target, texture, 0);
the second argument there should actually be GL_DEPTH_ATTACHMENT_EXT
in my case. Am I way off? If not, is there any workaround or planned
fix for this?
Thanks,
Peter
--
[ signature omitted ]
Message 2 in thread
Hi Peter,
Peter Cardwell wrote:
> Hi,
>
> I'm trying to use the QGLFramebufferObject class to do projective shadow
> mapping, which means I would like to bind the depth component of a
> rendered scene as a texture. Is there any way to do this? I find that if
> I just set the internal format to GL_DEPTH_COMPONENT I get the following
> error:
>
> [qglframebufferobject.cpp line 141] GL Error: 1282
> QGLFramebufferObject: Framebuffer incomplete attachment.
> QGLFramebufferObject: Framebuffer incomplete attachment.
>
>
> From what I can tell this is because on line 138 of
> qglframebufferobject.cpp:
> glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
> target, texture, 0);
> the second argument there should actually be GL_DEPTH_ATTACHMENT_EXT in
> my case. Am I way off? If not, is there any workaround or planned fix
> for this?
As you probably found out, this is not supported out of the box. You can
still set up your own attachments by using the handle returned by
QGLFramebufferObject::handle().
--
[ signature omitted ]