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:
parent
3f9ab5689c
commit
a3b2ac63b3
@ -356,7 +356,7 @@ void ReaderWriterOBJ::buildMaterialToStateSetMap(obj::Model& model, MaterialToSt
|
|||||||
osg_material->setDiffuse(osg::Material::FRONT_AND_BACK,material.diffuse);
|
osg_material->setDiffuse(osg::Material::FRONT_AND_BACK,material.diffuse);
|
||||||
osg_material->setEmission(osg::Material::FRONT_AND_BACK,material.emissive);
|
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);
|
osg_material->setSpecular(osg::Material::FRONT_AND_BACK,material.specular);
|
||||||
} else {
|
} else {
|
||||||
osg_material->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0,0,0,1));
|
osg_material->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0,0,0,1));
|
||||||
|
Loading…
Reference in New Issue
Block a user