Forum

Superphysical - Lights increase saturation, not brightness

I have mostly transitioned from Superphong to Superphysical for IBL, but for classic lighting with spot, directional or point lights, I am struggling to get results that resemble Superphong.

One of the main differences between Superphong and Superphysical is the way materials are handled, and I much prefer the metallicness and roughness approach.

For the lights instead of IAtt0, IAtt1 and IAtt2, there is now just IAtt0 (light intensity) and IAtt1 (falloff), but the values are very different. In superphong I had them all set around 0.3, but in superphysical its more like Intensity 10 and Falloff 0. But the lights just dont behave the same and in my eyes more correct way of Superphong:

When you move a light closer to a colored object the object should get brighter (ie. whiter if the light is also just white). But in SuperPhysical the colored objects get a little bit brighter, but also more saturated. See in the images below how the red objects turn pink in SuperPhysical. Tweaking all parameters I just can’t get it to look as natural as it did in SuperPhong.

Light far away in Superphong:

Light far away in Superphysical:

Light close in Superphong:

Light close in Superphysical (note unnatural colors):

Its almost like the increased value for saturation should be an increased value in brightness.

Any ideas, @vux, @dottore or @catweasel ?

Hi,
so the short answer to your question is: This is exactly (kind of) how the lighting is supposed to behave.

Going more into detail, we would have to look at how light behaves in the real world and how this shading model approximates it. So for example if you have a totally red real world object, the diffuse light, that is returned from it will always be red, since all other light wavelengths are absorbed. Only the totally reflected light (specular in our computer graphics case) is white (or the color of the light). That is basically why things don’t get more white, even if you have a very bright light in your scene. Even in reality you need a ridiculously bright light to have a colored object appear white - this would mean, that so much light is directly reflected, that your eye mostly sees the reflected (maybe white) light.
If anyone with a more profound knowledge of physics would like to extend or correct this explaination, I would welcome it!

Now you correctly pointed out, that colored objects tend to shift color, when the light in the scene is very bright. So in your example the red is getting pinkish. This is because your object is not 100% red but also has information in the blue channel. As the red can’t get anymore red at some point: RGB(1,g,b) the ratio of R to G to B starts to shift as the blue channel is still increasing and the red channel is already clamped. Resulting in a different color.
In this case I would say the light is already too bright. You could darken it our reduce the gamma in a posteffect.
A solution in shader would be to clamp the diffuse color to the albedo color. I will think about what is the best way to implement this in the upcoming version of SuperPhysical.
For now you could go to CookTorrance.fxh and change the last line to:
return ( min( ( (kD * albedo.xyz / PI + specular) * radiance * NdotL), albedo) + (lDiff * projectionColor * 2 / pow(lightDist,sssFalloff) * sss) ) * ao;

If for artistic reasons you would like the light to be additive as it was in SuperPhong chage the line to:
return (((kD + albedo.xyz / PI + specular) * radiance * NdotL) + (lDiff * projectionColor * 2 / pow(lightDist,sssFalloff) * sss) ) * ao;

This will just add the light, which is physically incorrect and for my taste also undesirable.

In the next version of SuperPhysical there will also be an emissive channel, which can be used if you would like to have very bright objects, independent of the light setup.

Hope that answers you question!

1 Like

Thanks @mburk for the thorough explanation!

I get why its happening now, even though I think it doesn’t quite look as desired, because it doesn’t look that natural (even though on paper it might be the real formula). The color shift just doesn’t happen in real life or at least our eyes dont perceive it like that and in that regard I preferred the look of Superphong.

I will play around with editing that last line to get the desired outcome and prevent the color shift.

Really looking forward to any new version and thanks so much for providing us with such a cool shader!

You*re welcome. Just to make that clear: The color-shift isn’t supposed to happen, I will look into this. This was only to explain how it comes to that. I could imagine, that it might be nice, if the light blending would work in a way that the color is getting more bright with increasing light and if the brightness goes over the initial albedo color it is added. But will have to try this out.

Okay, yeah that makes sense. Here are the first results:

Superphysical (normal):

Superphysical (with your first suggestion):

Superphysical (with superphong style):

So yes, the last one doesn’t look right, but at least it doesn’t have the color shift. The second one has much less highlights, and doesn’t look quite right either. I guess a mix of the first and the last would be good.

Could this be related to what kind of color system is used to calculate the colors? There is a major difference in what happens when brightness goes up in HSL and HSV, with one doing exactly this saturation shift when brightness goes above one. I’ll make a little demo for it.

Not sure if its related, but it caused me a few head scratches before realizing the difference:

hsv_vs_hsl.v4p (5.2 KB)

Oh yeah, another thing I should mention that I am not sure why its happening. If I turn off ALL lights and have 0 IBL Strength, then lighter colors still show, in this case the reds:

Its almost like there is emission already!? Shouldn’t they be completely black if there is no lights and no IBL?

Ok, first regarding your three screenshots:
I think the first one still works and looks best, if you don’t use overly bright lights, this should be the way to go. Also my first dirty fix for avoiding the color shifting doesn’t seem good enough.

HSV vs HSL:
I don’t think this is directly comparable. The shader just uses plain RGB to represent the colors. The point is that the Albedo is multiplied with the other light so the question is more how to handle light brighter than 1. (Roughly speaking)
Converting ti a different color representation could be helpful here, but this is also expensive.

In the end you definitely got a point here…I will have another good look at the light blending before releasing the updated version of SuperPhysical.

Lastly:
If all lights are off, you shouldn’t see anything. I just downloaded the contribution and cannot confirm the behaviour in your screenshot. There is no emissive yet.

Thanks for the info. I will dig around a little and see why the colors are there. I am adding quite a lot of effects like DoF, Glow, AO, so maybe its one of those. I’ll report back my findings.

Okay, its related to the Global Diffuse Color. I had the same color input as for Albedo for those. If I set the Global Diffuse and Global Reflection Color to black, then nothing is visible when all lights are off.

Could you briefly explain, what Global Diffuse Color is for?

GlobalDiffuseColor and GlobalReflectionColor can be viewed as a global light with no direction or location. Some sort of “omni light”. The use case for me is mostly if I do the shading of an object in front of a colored background and I want this to be reflected in the lighting of the scene. You can view at as a cheap way to simulate some global illumination.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.