Page 1 of 1

[Patch] Sun Intensity [was: Sun Light]

PostPosted: Thu Apr 13, 2017 2:26 pm
by HarryTuttle
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
mta01.jpeg
mta01.jpeg (230.17 KiB) Viewed 2476 times


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

Re: [Patch] Sun Light

PostPosted: Thu Apr 13, 2017 2:35 pm
by Ian
Well spotted :) will push this one later :)