mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-25 23:25:40 +00:00
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:
parent
1532168af7
commit
97781108e8
|
@ -1183,9 +1183,14 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data)
|
|||
shade = (shade + 1) / 2; // Viewport ambient seems to effect fixed shading. Technically vp ambient can change dynamically, but not an issue in practise. If it was we would need this logic in shader
|
||||
}
|
||||
}
|
||||
else {
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue