Sunil S Nandihalli writes: > 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..
You also have to deactivate face culling for st with GL_CULL_FACE. -- Alberto _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

