Hi Guys
I've been tasked with getting shadow mapping running on IOS using gles2.
I've run into a stumbling block in that the the rtt camera FBO is failing to
init, output below
Setting up osg::Camera::FRAME_BUFFER_OBJECT
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
OpenGL extension 'WGL_ARB_render_texture' is not supported. <-- might be
relavent
My rtt texture and camera is setup as follows
_shadowMap = new osg::Texture2D();
_shadowMap->setTextureSize(shadowMapRes.x(), shadowMapRes.y());
_shadowMap->setInternalFormat(GL_DEPTH_COMPONENT);
_shadowMap->setShadowComparison(true);
_shadowMap->setShadowTextureMode(osg::Texture::LUMINANCE);
_shadowMap->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
_shadowMap->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
//create prerender camera to render into the shadowmap texture
_shadowMapRenderCamera = new osg::Camera();
// set viewport
_shadowMapRenderCamera->setViewport(0,0,shadowMapRes.x(),shadowMapRes.y());
_shadowMapRenderCamera->setClearMask(GL_DEPTH_BUFFER_BIT |
GL_COLOR_BUFFER_BIT);
_shadowMapRenderCamera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
_shadowMapRenderCamera->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
_shadowMapRenderCamera->setRenderOrder(osg::Camera::PRE_RENDER);
_shadowMapRenderCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
_shadowMapRenderCamera->attach(osg::Camera::DEPTH_BUFFER,
_shadowMap.get());
//_shadowMapRenderCamera->attach(osg::Camera::COLOR_BUFFER0,
_shadowMap.get());
I took the above from some old code using CameraNode and was wondering
if GL_DEPTH_COMPONENT was correct, changing to GL_RGBA, GL_LUMINANCE
produces the correct results, only depth maps have the issue. I did a quick
search and found a supported depth texture extension,info below.
http://www.khronos.org/registry/gles/extensions/OES/OES_depth_texture.txt
If you read the above it states under issue 3 that 24 bit depth is not
supported. I've setup my context with 16 bit depth but still no luck.
Anyone have any advice
Cheers
Tom
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org