Hi Peter,
As the osg fog is a wrapper for the (fixed functionality) OpenGL fog,
you can use the OpenGL docs for this. There you will see that the start
and end values only make sense for the linear mode, not for exp or exp2.
However, density does make sense for exp and exp2.
Regards, good luck
Raymond
Peter Wraae Marino wrote:
hi users,
i have tried to create a simple example using fog. As I understand it
the start and end values define where the fog starts and ends relative
to the camera?
but....
not matter what values I use it doesn't effect my rendering. I seem to
always get the same fog rendering.
can someone explain/clarifiy what I'm not understanding?
Here is the code if you need to test:
#include <osg/ShapeDrawable>
#include <osg/fog>
osg::Node* CreateScene()
{
osg::Geode* pGeode = new osg::Geode();
for ( int x=0; x<10; x++ )
{
for ( int y=0; y<10; y++ )
{
pGeode->addDrawable( new osg::ShapeDrawable( new
osg::Sphere(osg::Vec3(x,y,0.0f),0.3f) ) );
}
}
osg::Fog* pFog = new osg::Fog();
pFog->setMode( osg::Fog::EXP2 );
pFog->setColor( osg::Vec4( 1, 1, 1, 1) );
pFog->setStart( 5 );
pFog->setEnd( 20 );
pFog->setDensity( 0.08f );
pGeode->getOrCreateStateSet()->setAttribute( pFog,
osg::StateAttribute::ON );
pGeode->getOrCreateStateSet()->setMode( GL_FOG,
osg::StateAttribute::ON );
return pGeode;
}
regards,
Peter Wraae Marino
http://osghelp.com <http://osghelp.com/>
------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org