mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
light parameters must be clamped (HarryTuttle)
This commit is contained in:
parent
391aafd4c1
commit
fc50bdee98
|
@ -756,6 +756,9 @@ void CNew3D::RenderViewport(UINT32 addr)
|
||||||
vp->lightingParams[4] = (float)((vpnode[0x24] >> 8) & 0xFF) * (1.0f / 255.0f); // ambient intensity
|
vp->lightingParams[4] = (float)((vpnode[0x24] >> 8) & 0xFF) * (1.0f / 255.0f); // ambient intensity
|
||||||
vp->lightingParams[5] = 0.0; // reserved
|
vp->lightingParams[5] = 0.0; // reserved
|
||||||
|
|
||||||
|
vp->lightingParams[3] = std::max(0.f, std::min(vp->lightingParams[3], 1.0f)); // clamp sun values
|
||||||
|
vp->lightingParams[4] = std::max(0.f, std::min(vp->lightingParams[4], 1.0f)); // std::clamp would be easier but c++17 .. sigh.
|
||||||
|
|
||||||
// Spotlight
|
// Spotlight
|
||||||
int spotColorIdx = (vpnode[0x20] >> 11) & 7; // spotlight color index
|
int spotColorIdx = (vpnode[0x20] >> 11) & 7; // spotlight color index
|
||||||
int spotFogColorIdx = (vpnode[0x20] >> 8) & 7; // spotlight on fog color index
|
int spotFogColorIdx = (vpnode[0x20] >> 8) & 7; // spotlight on fog color index
|
||||||
|
|
Loading…
Reference in a new issue