[Patch] Sun Shading

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!

Re: [Patch] Sun Shading

Postby Ian » Mon Nov 06, 2017 10:38 am

I had a brief look at this last night, I couldn't see any obvious differences?
In your first screenshot, the real version looks quite washed of green, not sure if that's simply an artifact from the video
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 1:24 pm

Ian wrote:I couldn't see any obvious differences?

It's a good thing you didn't! :)
The comparison was done on purpose, to show that using ambient light term in luminous polygons math was the right choice. :)

Those video captures are from (top to bottom) icuk7, Abelardo, Abelardo. They were slightly color corrected to compensate for the wrong overall tint, had also black and white level corrected (to avoid bright black areas or dimmed whites) and a little gamma corrected to better harmonize color transition. Nothing really extreme, just a little effort to color match Supermodel and see if luminous objects had the wrong brightness.
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Mon Nov 06, 2017 1:28 pm

else {
colour.rgb *= 1.0 + lighting[1].y;
}


So you think this one is correct? Did you have any screenshots were simply using 1.5 looked broken?
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 1:35 pm

EDIT: removed wrong example game....
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 1:49 pm

Ian wrote:So you think this one is correct? Did you have any screenshots were simply using 1.5 looked broken?


I found more logical to include ambient light into the math, since it was already used for fixed shaded polys. Then I searched for visible differences and found none.

Mathematically, there are instead slightly differences, as the ambient value sometimes is different from 0.5. But the problem is: even when using the 0.5 constant in place, there are some cases (Scud fires at the beginning of the race) where the end result is not really 1.0.

Visually none of the two methods looked really broken.
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Mon Nov 06, 2017 2:32 pm

Does it need to add up to exactly 1.0 ? :) I thought the whole point of multiplying by 1.5 was to allow a more dynamic range in the lighting.
Lemans24 is using a colour table I think to dynamically change the colour of the trees, depending on the time of day. Not sure it needs an ambient component as well. The logic could be 100% correct, but it's hard to say without visible test cases :)
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 2:45 pm

Not strictly related: I'm currently back on fixed shading logic as I've visual confirmation it applies even to non-textured polygons (L.A. Machineguns intro). I've also the suspect that it doesn't apply to transparent polygons. I'm still testing to confirm all this. As soon I can I'll post some screenshot and, if needed, a patch.

Stay tuned :)

EDIT:

Posted the patch to the relevant topic.
Last edited by HarryTuttle on Mon Nov 06, 2017 5:00 pm, edited 1 time in total.
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 3:03 pm

Ian wrote:Does it need to add up to exactly 1.0 ? :) I thought the whole point of multiplying by 1.5 was to allow a more dynamic range in the lighting.


The problem is: for some of the Scud's fires you have a value that is still below 1.0 and they should supposedly be at least 1.0 being luminous objects. With 0.5 the final value is less than the result using the ambient term. Those particular little corner cases made me consider the ambient term in place of 0.5 constant.
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Mon Nov 06, 2017 3:17 pm

You sure they should be full bright? When I looked at it before, matching the white value of the 2d layer against the brightest parts of the torches in the media level. The torches looked darker, which let me to conclude they weren't full bright. But it's hard to tell from captures.
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Mon Nov 06, 2017 3:33 pm

Ian wrote:When I looked at it before, matching the white value of the 2d layer against the brightest parts of the torches in the media level. The torches looked darker, which let me to conclude they weren't full bright. But it's hard to tell from captures.


And we've to consider also the possibility they gamma corrected the 3d layer. I think gamma is used in LeMans24, not by a great extent, but trying to gamma match both 2d and 3d layers with icuk7 video capture revealed that one layer is generally brighter than the other. But, again, the difference is subtle.
User avatar
HarryTuttle
 
Posts: 624
Joined: Thu Mar 09, 2017 8:57 am

Previous

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 3 guests