A second go at fixing the fixed lighting in star wars .. Fixed shading is per vertex poly colours. For some reason in star wars they are treated as unsigned values instead of signed, like in every other game. These polys are all marked with specular enabled, where as in the rest of the games they are missing this flag. That's the only difference I can find.

This commit is contained in:
Ian Curtis 2017-06-21 17:04:53 +00:00
parent 1532168af7
commit 97781108e8

View file

@ -1184,7 +1184,12 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data)
}
}
else {
shade = (((ix + 128) & 0xFF) / 255.f); // Step 2+ uses signed or unsigned values for lighting 0-255. Todo finish this logic
if (ph.SpecularEnabled()) {
shade = (ix & 0xFF) / 255.f; // Star wars is the only game to use unsigned fixed shaded values. It's also the only game to set the specular flag on these polys
}
else {
shade = (((ix + 128) & 0xFF) / 255.f); // Step 2+ uses signed or unsigned values for lighting 0-255. Todo finish this logic
}
}
shade += offset;