*
Hi Tony and Alberto,
 The following is a snippet of the code I have tried .. It continues to
light up only one side of the geometry ...

osg::StateSet* st = topo->getOrCreateStateSet(); *
*osg::Group* topo = new osg::Group;
*
*osg::Material* matirial = new osg::Material; *
*matirial->setColorMode(osg::Material::DIFFUSE); *
*matirial->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 1, 0,
1)); *
*matirial->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 1, 0,
1)); *
*matirial->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 1, 0,
1)); *
*matirial->setShininess(osg::Material::FRONT_AND_BACK, 10.0f); *
*st->setAttributeAndModes (matirial,osg::StateAttribute::ON); *
*osg::LightModel* ltModel = new osg::LightModel; *
*ltModel->setTwoSided(true); *
*st->setAttribute(ltModel); *
*/* render the geometry in the children nodes ... */*


If I reverse the normals the opposite side lights up as expected .. Am I
doing something wrong..
Sunil.
On Tue, Jun 29, 2010 at 2:23 PM, Tony Horrobin <[email protected]
> wrote:

> Hi Sunil,
>
> Just to be clear, you also need to specify a two-sided light model to make
> OpenGL apply both front and back materials.
> The osg::LightModel class allows this.
>
> Cheers,
>
> -Tony
>
>
> _______________________________________________
> 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

Reply via email to