diff --git a/src/osg/FrameBufferObject.cpp b/src/osg/FrameBufferObject.cpp index 158a99f69..9990ecb82 100644 --- a/src/osg/FrameBufferObject.cpp +++ b/src/osg/FrameBufferObject.cpp @@ -561,13 +561,23 @@ void FrameBufferAttachment::attach(State &state, GLenum target, GLenum attachmen break; case Pimpl::TEXTURE3D: if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER) - ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level); + { + 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; case Pimpl::TEXTURE2DARRAY: - if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER) - ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level); + if (_ximpl->cubeMapFace == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER) + { + if (ext->glFramebufferTexture) + { + ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level); + } + } else ext->glFramebufferTextureLayer(target, attachment_point, tobj->id(), _ximpl->level, _ximpl->zoffset); break; @@ -576,7 +586,12 @@ void FrameBufferAttachment::attach(State &state, GLenum target, GLenum attachmen break; case Pimpl::TEXTURECUBE: if (_ximpl->cubeMapFace == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER) - ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level); + { + if (ext->glFramebufferTexture) + { + ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level); + } + } else ext->glFramebufferTexture2D(target, attachment_point, GL_TEXTURE_CUBE_MAP_POSITIVE_X + _ximpl->cubeMapFace, tobj->id(), _ximpl->level); break;