[osg-users] Fog problem

Eric ZAREMBA eric.zaremba at ersa-france.com
Thu Jul 10 04:29:01 PDT 2008


Hi,

Ok, osgprecipitation lz.osg works.
So, I looked into the code and see it set the attribute and mode with the osg::Fog from the precipitation instead of just enable the GL_FOG mode and let the precipitationEffect do its work itself.
I correct my program and it run yet! Thanks a lot Robert!

Now, I think it is normal to obtain undefined result if I enable fog without set the other attributes... But I still ask me why it worked until yesterday, since I introduced precipitation two weeks ago!

"Les voies du seigneur sont impénétrables..."

Thanks again!

-----Message d'origine-----
De : osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces at lists.openscenegraph.org] De la part de Robert Osfield
Envoyé : jeudi 10 juillet 2008 13:00
À : OpenSceneGraph Users
Objet : Re: [osg-users] Fog problem

Hi Eric,

What happens when you run:

  osgprecipitation lz.osg

Robert.

On Thu, Jul 10, 2008 at 11:22 AM, Eric ZAREMBA
<eric.zaremba at ersa-france.com> wrote:
> 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.
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list