From Thomas Hogarth, "Apple have decided in their eternal wisdom to do away with separate depth and stencil buffers on iOS from version 5 and above.

Attached are changes to GraphicsWindowIOS.mm to support setting up the new buffer type when compiling for iOS5,
also attached is a small change to FrameBufferObject.cpp to report support for packed depth stencil via the
GL_OES_packed_depth_stencil extension.

For anyone reading this you can attach a packed depth stencil to your FBO like so

_rttCamera->attach( osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, GL_DEPTH24_STENCIL8_EXT );

Luckily GL_DEPTH24_STENCIL8_EXT happens to have the same value as iOSs GL_DEPTH24_STENCIL8_OES"
This commit is contained in:
Robert Osfield
2012-09-27 08:34:56 +00:00
parent 03047f3e7f
commit 4896edda56
2 changed files with 36 additions and 7 deletions

View File

@@ -113,7 +113,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
LOAD_FBO_EXT(glRenderbufferStorageMultisampleCoverageNV);
_packed_depth_stencil_supported = OSG_GL3_FEATURES ||
(isGLExtensionSupported(contextID, "GL_EXT_packed_depth_stencil"));
(isGLExtensionSupported(contextID, "GL_EXT_packed_depth_stencil")) ||
(isGLExtensionSupported(contextID, "GL_OES_packed_depth_stencil"));
}