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
e1dc169915
commit
4c1349c658
@ -359,7 +359,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