mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 15:39:42 +00:00
Fix/workaround specular issues
The glossiness should not be multiplied by 255, however the values set in many of Bloodmoon's meshes would look horrible otherwise. Now we can let the NiSpecularProperty specify when to enable specular (which is supposed to default to on, but due to the aforementioned meshes, we default to off).
This commit is contained in:
parent
7930aa82b2
commit
21e2c287eb
1 changed files with 3 additions and 2 deletions
|
@ -573,7 +573,8 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
|
|||
int vertMode = 2;
|
||||
//int lightMode = 1;
|
||||
int depthFlags = 3;
|
||||
int specFlags = 1;
|
||||
// Default should be 1, but Bloodmoon's models are broken
|
||||
int specFlags = 0;
|
||||
Ogre::String texName;
|
||||
|
||||
bool vertexColour = (shape->data->colors.size() != 0);
|
||||
|
@ -715,7 +716,7 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
|
|||
if(specFlags)
|
||||
{
|
||||
instance->setProperty("specular", sh::makeProperty(
|
||||
new sh::Vector4(specular.x, specular.y, specular.z, glossiness*255.0f)));
|
||||
new sh::Vector4(specular.x, specular.y, specular.z, glossiness)));
|
||||
}
|
||||
|
||||
instance->setProperty("diffuseMap", sh::makeProperty(texName));
|
||||
|
|
Loading…
Reference in a new issue