mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 10:06:42 +00:00
Use correct ambient/diffuse default values when no NiMaterialProperty exists
This commit is contained in:
parent
9ee99a751c
commit
b072e803ce
1 changed files with 5 additions and 1 deletions
|
@ -1314,7 +1314,11 @@ namespace NifOsg
|
||||||
int specFlags = 0; // Specular is disabled by default, even if there's a specular color in the NiMaterialProperty
|
int specFlags = 0; // Specular is disabled by default, even if there's a specular color in the NiMaterialProperty
|
||||||
osg::Material* mat = new osg::Material;
|
osg::Material* mat = new osg::Material;
|
||||||
mat->setColorMode(hasVertexColors ? osg::Material::AMBIENT_AND_DIFFUSE : osg::Material::OFF);
|
mat->setColorMode(hasVertexColors ? osg::Material::AMBIENT_AND_DIFFUSE : osg::Material::OFF);
|
||||||
// TODO: check if the OpenGL default material values are actually the default NIF material values, for when there's no NiMaterialProperty
|
|
||||||
|
// NIF material defaults don't match OpenGL defaults
|
||||||
|
mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
|
mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
|
|
||||||
for (std::vector<const Nif::Property*>::const_reverse_iterator it = properties.rbegin(); it != properties.rend(); ++it)
|
for (std::vector<const Nif::Property*>::const_reverse_iterator it = properties.rbegin(); it != properties.rend(); ++it)
|
||||||
{
|
{
|
||||||
const Nif::Property* property = *it;
|
const Nif::Property* property = *it;
|
||||||
|
|
Loading…
Reference in a new issue