Page 24 of 24

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 10:38 am
by Ian
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

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 1:24 pm
by HarryTuttle
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.

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 1:28 pm
by Ian
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?

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 1:35 pm
by HarryTuttle
EDIT: removed wrong example game....

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 1:49 pm
by HarryTuttle
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.

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 2:32 pm
by Ian
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 :)

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 2:45 pm
by HarryTuttle
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.

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 3:03 pm
by HarryTuttle
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.

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 3:17 pm
by Ian
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.

Re: [Patch] Sun Shading

PostPosted: Mon Nov 06, 2017 3:33 pm
by HarryTuttle
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.