[Patch] Sun Intensity [was: Sun Light]

Just a little fix for sun light intensity. I've clamped to 1, as sometimes goes over that value and in some case (Magical Truck Adventure) goes to 255, like in the following case:
Left: bad sunlight intensity, Right: sun intensity clamped to 1
The fix in <New3D.cpp>:
Please note: currently in the fragment shader of the official build, the sun ambient+intensity is clamped to 0-1 so the bad effect is less pronounced, but the problem is still there.
EDIT:
The Real 3D Pro 1000 devguide states that sun intensity value should be a float in the interval 0-1
Left: bad sunlight intensity, Right: sun intensity clamped to 1
The fix in <New3D.cpp>:
- Code: Select all
vp->lightingParams[3] = *(float *)&vpnode[0x07]; // sun intensity
vp->lightingParams[3] = std::min(1.0f, vp->lightingParams[3]); // limit to 1.0
Please note: currently in the fragment shader of the official build, the sun ambient+intensity is clamped to 0-1 so the bad effect is less pronounced, but the problem is still there.
EDIT:
The Real 3D Pro 1000 devguide states that sun intensity value should be a float in the interval 0-1