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<osgShadow::ShadowMap> 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.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000])
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