From 4c1349c658e67271034857575ca9384064c391b6 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 25 Sep 2017 13:59:13 +0200 Subject: [PATCH] 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. --- src/osgPlugins/obj/ReaderWriterOBJ.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/obj/ReaderWriterOBJ.cpp b/src/osgPlugins/obj/ReaderWriterOBJ.cpp index 88aebdc0c..2fe238310 100644 --- a/src/osgPlugins/obj/ReaderWriterOBJ.cpp +++ b/src/osgPlugins/obj/ReaderWriterOBJ.cpp @@ -359,7 +359,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));