I have a rather large mesh, (which I load with osgDB). It also has several sub-meshes.
I am trying to set the emission lighting. However I can see (suspect) that only the 1st sub-mesh is lit up. How is it possible to light up all the sub-meshes. I am not using lighting to lit up the scene.
What is the recommended approach?
int main()
{
osg::Node * cytBuilding = osgDB::readNodeFile( OBJ_FILE );
osg::Group * root = new osg::Group();
osg::PositionAttitudeTransform * scenePAT = new osg::PositionAttitudeTransform();
root->addChild(scenePAT);
scenePAT->addChild( cytBuilding );
//material
osg::Material* material = new osg::Material();
material->setAmbient(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
material->setDiffuse(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
material->setSpecular(osg::Material::FRONT, osg::Vec4(0.0,0.0f,0.0f,1.0f));
material->setEmission(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
osg::StateSet* stateset = new osg::StateSet();
stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
root->setStateSet(stateset);
// viewer
osgViewer::Viewer viewer;
viewer.setSceneData( root );
viewer.realize();
return viewer.run();
As I read the mesh (osgDB::readNodeFile()), it display following error messages
*** line not handled *** :map_bump
*** line not handled *** :bump
*** line not handled *** :map_opacity
*** line not handled *** :map_d
*** line not handled *** :refl
*** line not handled *** :map_kS
*** line not handled *** :map_Ns