I have a few geometries where I would like the material to display on
both sides and having the correct normals.

I have tried to just turn on the two sided light model, but things get
really ugly then.

Here is the material used...

        osg::Material * matPin = new osg::Material();
        matPin->setAmbient(     osg::Material::FRONT_AND_BACK, OHole );
        matPin->setDiffuse(     osg::Material::FRONT_AND_BACK, OHole );
        matPin->setSpecular(    osg::Material::FRONT_AND_BACK, OHole );
        matPin->setShininess(   osg::Material::FRONT_AND_BACK, 64.0f);

        osgHCore->m_OtherHoleSS = new osg::StateSet();
        osgHCore->m_OtherHoleSS->setAttributeAndModes(    matPin,
osg::StateAttribute::ON );

    /************************************
        osg::LightModel* lightmodel = new osg::LightModel;
        lightmodel->setTwoSided( true );
        osgHCore->m_OtherHoleSS->setAttributeAndModes(lightmodel,
osg::StateAttribute::ON );
    ************************************/

I've attached 2 images.  cyl-wo-lightmodel.jpg has the lightmodel
commented out as shown above.  cyl-w-lightmodel.jpg is with it
uncommented. (-with- & -without-).

Notice the weird lighting of the square pads.  This material is only
attached to the hole cylinder geode.

Ideas?

Thanks,
Greg



<<attachment: cyl-wo-lightmodel.jpg>>

<<attachment: cyl-w-lightmodel.jpg>>

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to