obj plugin: Fix bug not using specular color (Ks) for illumination mode > 2

See paragraph "Illumination models" at http://paulbourke.net/dataformats/mtl/ for details.
This commit is contained in:
Ralf Habacker 2017-09-25 13:59:13 +02:00
parent 3f9ab5689c
commit a3b2ac63b3

View File

@ -356,7 +356,7 @@ void ReaderWriterOBJ::buildMaterialToStateSetMap(obj::Model& model, MaterialToSt
osg_material->setDiffuse(osg::Material::FRONT_AND_BACK,material.diffuse);
osg_material->setEmission(osg::Material::FRONT_AND_BACK,material.emissive);
if (material.illum == 2) {
if (material.illum >= 2) {
osg_material->setSpecular(osg::Material::FRONT_AND_BACK,material.specular);
} else {
osg_material->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0,0,0,1));