[Patch] Sun Intensity [was: Sun Light]

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

[Patch] Sun Intensity [was: Sun Light]

Postby HarryTuttle » Thu Apr 13, 2017 2:26 pm

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
Last edited by HarryTuttle on Tue Aug 01, 2017 7:17 pm, edited 1 time in total.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Light

Postby Ian » Thu Apr 13, 2017 2:35 pm

Well spotted :) will push this one later :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am


Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest