Hi Frederic,
On Wed, Jun 2, 2010 at 2:42 PM, Frederic Bouvier <[email protected]> wrote:
> Maybe you should change :
>
> if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
>
> into :
>
> if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER &&
> ext->glFramebufferTexture )
>
> when trying to use the extension
On the right track, but this would introduce a bug where the settings
would be applied to the wrong type of FBO. There isn't any sensible
low level fallback when glFramebufferTexture so we can only do a
non-op to avoid crash, possibly emit a warning. With extensions like
this it's best for applications to check to make sure the extension is
available before building a scene graph that uses it.
I have gone for the implementation of the style:
case Pimpl::TEXTURE3D:
if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
{
if (ext->glFramebufferTexture)
{
ext->glFramebufferTexture(target, attachment_point,
tobj->id(), _ximpl->level);
}
}
else
ext->glFramebufferTexture3D(target, attachment_point,
GL_TEXTURE_3D, tobj->id(), _ximpl->level, _ximpl->zoffset);
break;
This is now checked into svn/trunk.
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org