[osg-users] Problem setting a skydome
aluaces at udc.es
Wed Jul 16 02:06:36 PDT 2008
thank you very much for your help so far. What you say sounds sensible,
however I think my implementation still has bugs, because it behaves
differently on several computers (one works, the other don't). What I have so
// root -> camera -> clearnode -> skydome
// |--> rest_of_scene
osg::Camera *camera = new osg::Camera;
osg::ClearNode* clearNode = new osg::ClearNode;
osg::StateSet* stateset = SkydomeSubgraphNode->getOrCreateStateSet();
osg::TexEnv* te = new osg::TexEnv;
stateset->setTextureAttributeAndModes(0, te, osg::StateAttribute::ON);
stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
stateset->setMode( GL_CULL_FACE, osg::StateAttribute::ON );
osg::Depth* depth = new osg::Depth;
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON );
does something look weird to you?
El Martes 15 Julio 2008ES 10:32:55 David Spilling escribió:
> > skydome->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR
> > > a class osg::Camera inherits from
> Sorry - missed a step. Put a Camera in above your skydome.
> A solution that comes to my mind is to use a pair of cameras, one rendering
> > the skydome with the setting you said, DO_NOT_COMPUTE_NEAR_FAR, and the
> > other
> > rendering the rest of the scene.
> Exactly. That's what I do (although I control a bunch of other stuff in the
> camera, like projection matrix, in order to avoid the later issues).
More information about the osg-users