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 199651ebbd
commit 49ad02dffe

View File

@ -333,7 +333,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));