Re: [osg-users] OSG 3.0 and osgShadow texture unit problems
Wojciech, You were right I was using osg::Texture::Extensions::getNumTextureUnits which on 2.8.5 returns GL_MAX_TEXTURE_UNITS and on 3.0.0 returns GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS I have reverted to a simple glGetIntegerv(GL_MAX_TEXTURE_UNITS) Cheers, Roger -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41216#41216 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.0 and osgShadow texture unit problems
Wojciech Lewandowski wrote: > Hi, Roger, > > You might have 16 texture units but only 8 texture coords. And fixed > pipeline texgens of course can be set up to 7th stage. > > Cheers, > Wojciech I must admit I had not thought of that. But it was working on 2.8.5 on the same Opengl driver and hardware. I quess I will have to revert to a 2.8.5 build and rerun the trace to see what is different. I wonder if the getmaxtextureunit (or whatever it is) OSG call is reporting something different on 2.8.5. I use the high unit number to keep the shadow out of the way of some other stuff. Roger -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41213#41213 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.0 and osgShadow texture unit problems
Hi, Roger, You might have 16 texture units but only 8 texture coords. And fixed pipeline texgens of course can be set up to 7th stage. Cheers, Wojtek -Oryginalna wiadomość- From: Roger James Sent: Wednesday, July 06, 2011 7:50 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] OSG 3.0 and osgShadow texture unit problems Hi, I had some shadow code that was working well on 2.8.5 but will not work on 3.0.0. I verified that the same problem occurs with the OSG shadow example source. My test machine GPU (Nvidia) reports 16 texture units available. If I set the shadow texture unit number to anything higher than 7 then my OpenGL trace reports errors as soon as this texture unit is accessed (for texgens from the positionalStateContainer). This can be verified by adding the following patch to osgshadow.cpp. Code: else /* if (arguments.read("--sm")) */ { osg::ref_ptr sm = new osgShadow::ShadowMap; sm->setTextureUnit(8); shadowedScene->setShadowTechnique(sm.get()); int mapres = 1024; while (arguments.read("--mapres", mapres)) sm->setTextureSize(osg::Vec2s(mapres,mapres)); } Here is a snippet of the OpenGL trace. Code: glGetString(GL_VERSION)="2.1.2" glGetString(GL_RENDERER)="GeForce Go 7600/PCI/SSE2/..." glGetString(GL_VERSION)="2.1.2" ... glActiveTexture(GL_TEXTURE8) glLoadMatrixd([1.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,1.00]) glTexGendv(GL_S,GL_EYE_PLANE,0x2715740) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_T,GL_EYE_PLANE,0x2715768) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_R,GL_EYE_PLANE,0x2715790) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_Q,GL_EYE_PLANE,0x27157b8) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_R,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_Q,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION Has anyone got any idea what is going on here. Has 3.0 reserved some resources that have in some way reduced the number of available texture units? I am at a loss! Obviously I don't see any shadows! Roger Cheers, Roger[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41202#41202 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 3.0 and osgShadow texture unit problems
Hi, I had some shadow code that was working well on 2.8.5 but will not work on 3.0.0. I verified that the same problem occurs with the OSG shadow example source. My test machine GPU (Nvidia) reports 16 texture units available. If I set the shadow texture unit number to anything higher than 7 then my OpenGL trace reports errors as soon as this texture unit is accessed (for texgens from the positionalStateContainer). This can be verified by adding the following patch to osgshadow.cpp. Code: else /* if (arguments.read("--sm")) */ { osg::ref_ptr sm = new osgShadow::ShadowMap; sm->setTextureUnit(8); shadowedScene->setShadowTechnique(sm.get()); int mapres = 1024; while (arguments.read("--mapres", mapres)) sm->setTextureSize(osg::Vec2s(mapres,mapres)); } Here is a snippet of the OpenGL trace. Code: glGetString(GL_VERSION)="2.1.2" glGetString(GL_RENDERER)="GeForce Go 7600/PCI/SSE2/..." glGetString(GL_VERSION)="2.1.2" ... glActiveTexture(GL_TEXTURE8) glLoadMatrixd([1.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,1.00]) glTexGendv(GL_S,GL_EYE_PLANE,0x2715740) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_T,GL_EYE_PLANE,0x2715768) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_R,GL_EYE_PLANE,0x2715790) glGetError() =GL_INVALID_OPERATION glTexGendv(GL_Q,GL_EYE_PLANE,0x27157b8) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_R,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION glTexGeni(GL_Q,GL_TEXTURE_GEN_MODE,9216) glGetError() =GL_INVALID_OPERATION Has anyone got any idea what is going on here. Has 3.0 reserved some resources that have in some way reduced the number of available texture units? I am at a loss! Obviously I don't see any shadows! Roger Cheers, Roger[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41202#41202 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org