From Roger James, improved mapping of AC3D lighting model to OSG

This commit is contained in:
Robert Osfield
2006-08-28 19:07:30 +00:00
parent 6b186a122f
commit c8e7a9ea40

View File

@@ -24,6 +24,7 @@
#include <osg/StateSet>
#include <osg/Notify>
#include <osg/Texture2D>
#include <osg/LightModel>
#include <osgDB/FileNameUtils>
@@ -700,7 +701,12 @@ osg::Group *ac_load_object(std::istream &f,const ACObject *parent,const osgDB::R
dstate->setTextureAttributeAndModes(0,ob.texture.get(),osg::StateAttribute::ON);
}
if (asurf.flags & SURFACE_TWOSIDED)
{
osg::LightModel *pLightModel = new osg::LightModel;
pLightModel->setTwoSided(true);
dstate->setAttributeAndModes(pLightModel);
dstate->setMode( GL_CULL_FACE, osg::StateAttribute::OFF );
}
else
dstate->setMode( GL_CULL_FACE, osg::StateAttribute::ON );