[osg-users] Fog problem

Eric ZAREMBA eric.zaremba at ersa-france.com
Thu Jul 10 03:22:15 PDT 2008


Hi,

 

 

Since yesterday, I have a problem with fog.

When I turn it one, my scene becomes black, even if I deactivate the
lighting.

It is very strange, because I don't update my OSG version (which is
2.5.2) nor recompile it.

 

I make a small program to test this out of my other stuff, and test it
on two different machines (both under WinXP, one with an ATI FireGL, the
other with a NVidia QuadroFx).

 

// my minimal test program

int main ( int argc, char const *argv[] )

{

      osgViewer::Viewer myViewer;

      myViewer.addEventHandler(new osgViewer::StatsHandler);

      myViewer.addEventHandler(new
osgGA::StateSetManipulator(myViewer.getCamera()->getOrCreateStateSet()))
;

      myViewer.addEventHandler(new osgViewer::HelpHandler);

 

      osg::ref_ptr<osg::Group> pRoot = new osg::Group;

      osg::StateSet* stateset = pRoot->getOrCreateStateSet();

      stateset->setMode( GL_FOG, osg::StateAttribute::ON );

//    stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF );

 

      osgParticle::PrecipitationEffect* pe = new
osgParticle::PrecipitationEffect;

      pRoot->addChild( pe );

      pe->rain(0.3);

 

      osg::Node* pNode = osgDB::readNodeFile("lz.osg");

      pRoot->addChild( pNode );

 

      myViewer.setSceneData(pRoot.get());

      myViewer.realize();

      myViewer.run();

    return( 0 );

}

 

Computers drive me crazy! good will be the retirment, I will breed
rabits.

Eric Z.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080710/b59b0de3/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: black.png
Type: image/png
Size: 42433 bytes
Desc: black.png
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080710/b59b0de3/attachment-0002.png>


More information about the osg-users mailing list