Non luminous polygons seem to be effected by the lightModifier also. API seems to have no restriction in this regard, neither does the SDK. The ocean hunter requires this for some of the 2d stuff. Light modifier values only seem to exist between 0-16, which is strange for 5 bits of precision. Possibly top bit disables the effect and lower 4 bits are the value. This clearly differs from the SDK, but without this the values come out clearly wrong.

This commit is contained in:
Ian Curtis 2016-05-16 10:49:00 +00:00
parent 62eafacfc3
commit 9e279a0c1f
2 changed files with 3 additions and 11 deletions

View file

@ -886,16 +886,8 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data)
currentMesh->specularCoefficient = 0; // ph.SpecularValue();
}
}
/*
if (!ph.Luminous()) {
currentMesh->fogIntensity = 1.0f;
}
else {
currentMesh->fogIntensity = ph.LightModifier();
}*/
currentMesh->fogIntensity = 1.0;
currentMesh->fogIntensity = ph.LightModifier();
if (ph.TexEnabled()) {
currentMesh->format = ph.TexFormat();

View file

@ -330,7 +330,7 @@ bool PolyHeader::Luminous()
float PolyHeader::LightModifier()
{
return (float)((header[6] >> 11) & 0x1F) * (1.0f / 31.0f);
return ((header[6] >> 11) & 0x1F) * (1.0f / 16.0f);
}
//