Author Topic: Corona 5's skew towards red in overexposed scenes (incl. 3dsmax scene file)  (Read 7869 times)

2019-11-15, 20:32:26

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
Let me see if I can describe the scenario (latest Corona 5 in use with 3ds max):

You have a scene with a small spherical light, say 1 cm in size and which has no red component (e.g., RGB=0,96,255). It is a pretty strong light causing overexposure in the scene when viewed through the camera.

In front of the light (from the perspective of the camera), you have a glass hemisphere shell (i.e., imagine creating a 3-4 cm (in diameter) half-sphere (removing the flat bottom) and then using a 1-2 mm shell modifier on it, to create a fairly thin glass shell with an IOR of 1.5). Some details about the glass material are that it is blue in color , no diffuse (i.e., RGB=0,0,0, medium-blue reflection containing no red component and (RGB=0,10,160), a very light blue refraction containing no red component (e.g., RGB=0,10,255) and a glossiness of say 0.75 (not thin and no caustics).

So to use ASCII art you have this:

o)      >=#      (The 'o' is the light, the ')' is the hemisphere, and the >=# is the camera looking at it.)

In this very simple scene, the result is that the rendered light shining through the glass appears red or has an extremely strong red cast, even though there is no red component in the light source, or any parts of the material used for the glass.

So, it seems that Corona, when there is overexposure of blue, is adding a lot of red to the scene.
« Last Edit: 2019-11-19, 03:28:51 by SharpEars »

2019-11-18, 16:57:19
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
Pics or it didn't happen. ;)

Viewport screenshots would be great, and scene itself would be best.
My imagination is not good enough to simulate this, and I just failed to reproduce this in 3ds Max.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-11-18, 21:31:34
Reply #2

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
I suppose a scene file would be helpful to demonstrate this, so here is a picture and I attached the 3ds max 2020.1 scene file:



The expectation is that all of the colored lights remain blue with a possible trend towards a slight green tint with overexposure, due to a small green color component that is part of the color of the glass hemispheres.

There should be no red or magenta in the scene whatsoever, since neither glass covers nor the light have any Red component in their makeup. Notice how in the rightmost light, the red component appears equal to the blue (i.e., magenta), at least when converted to sRGB for viewing by Corona.

When I turn off all Corona post-processing, the image looks identical in the Corona frame buffer, so we can assume that all post-processing is turned off (see below):

« Last Edit: 2019-11-19, 03:25:43 by SharpEars »

2019-11-19, 19:10:59
Reply #3

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
Is someone looking into this?
« Last Edit: 2019-11-20, 16:17:39 by SharpEars »

2019-11-20, 16:19:03
Reply #4

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile

2019-11-20, 16:44:57
Reply #5

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
Sorry, we definitely will look into this ASAP!
Right now I am thinking it has to be related to Wide RGB color space that Corona is using.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-11-20, 16:55:38
Reply #6

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Is someone looking into this?

Bump...

Your camera is using Simple EV exposure despite your on/off VFB settings and your 3ds max auto-exposure from environment and effects. Please revert to Photographic ISO for more natural color correction and balanced exposure.

 Also when playing with color as absolute values I would suggest attaching a CoronaColor map and set to HDR solid color. Regarding the redness and the exposure seems to be directly related on the coloration of the refraction channel of the glass material, going for normal white doesn't affect the outcome, which I am guessing is due to some color absorption issues?

« Last Edit: 2019-11-20, 17:23:26 by Corona_GK »
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2019-11-20, 20:23:39
Reply #7

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
Is someone looking into this?

Bump...

Your camera is using Simple EV exposure despite your on/off VFB settings and your 3ds max auto-exposure from environment and effects. Please revert to Photographic ISO for more natural color correction and balanced exposure.

 Also when playing with color as absolute values I would suggest attaching a CoronaColor map and set to HDR solid color. Regarding the redness and the exposure seems to be directly related on the coloration of the refraction channel of the glass material, going for normal white doesn't affect the outcome, which I am guessing is due to some color absorption issues?

Will check on the 3ds max auto-exposure setting from environment/effect as you suggested, but AFAIK everything is turned off or inapplicable to this scene.

I thought the whole point of setting the Corona camera to "Simple EV" was not to deal with ISO/shutter-speed/aperture when motion blur and depth of field effects are not needed (i.e., use the equivalent of a still "pinhole" camera giving infinite Depth Of Field with no aperture size impact, only one scene is being rendered - no motion blur based on shutter speed, ISO is not relevant [in combination with shutter speed/aperture], because the EV value alone controls scene exposure).
Additional note: Setting the camera to use "ISO/Shutter speed/Aperture" instead of "Simple EV" will still cause the problem to be visible. Give it a try, after matching exposure with the Simple EV setting shown!

With regard to possible "absorption issues" stemming from the glass material, I don't buy it! There is zero RED component anywhere in this material. Please take a good look at its definition in 3ds max and tell me where you see any RED.

Finally, with regard to Corona's internal use of a/the "Wide RGB" color space, if this is the culprit then it is not being correctly mapped to the colors being displayed in Corona's own VFB window.
« Last Edit: 2019-11-20, 20:50:25 by SharpEars »

2019-11-21, 10:52:34
Reply #8

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Is someone looking into this?

Bump...

Your camera is using Simple EV exposure despite your on/off VFB settings and your 3ds max auto-exposure from environment and effects. Please revert to Photographic ISO for more natural color correction and balanced exposure.

 Also when playing with color as absolute values I would suggest attaching a CoronaColor map and set to HDR solid color. Regarding the redness and the exposure seems to be directly related on the coloration of the refraction channel of the glass material, going for normal white doesn't affect the outcome, which I am guessing is due to some color absorption issues?

Will check on the 3ds max auto-exposure setting from environment/effect as you suggested, but AFAIK everything is turned off or inapplicable to this scene.

I thought the whole point of setting the Corona camera to "Simple EV" was not to deal with ISO/shutter-speed/aperture when motion blur and depth of field effects are not needed (i.e., use the equivalent of a still "pinhole" camera giving infinite Depth Of Field with no aperture size impact, only one scene is being rendered - no motion blur based on shutter speed, ISO is not relevant [in combination with shutter speed/aperture], because the EV value alone controls scene exposure).
Additional note: Setting the camera to use "ISO/Shutter speed/Aperture" instead of "Simple EV" will still cause the problem to be visible. Give it a try, after matching exposure with the Simple EV setting shown!

With regard to possible "absorption issues" stemming from the glass material, I don't buy it! There is zero RED component anywhere in this material. Please take a good look at its definition in 3ds max and tell me where you see any RED.

Finally, with regard to Corona's internal use of a/the "Wide RGB" color space, if this is the culprit then it is not being correctly mapped to the colors being displayed in Corona's own VFB window.

Please check screenshots, the reason I've mentioned absorption. Personally I've always avoided using color for refraction channel it's really unreliable and it always produced strange render results whilst it was in mental_ray, V_ray, Corona, or red-shift. Going for fog color or, absorption/translucency always gave me better results. But maybe that's just me :).

Yeah I realize that altering exposure for Photographic ISO would eventually bring you back to the initial redness issue I just mentioned it because the simple EV exposure overrides the VFB, regarding: "When I turn off all Corona post-processing, the image looks identical in the Corona frame buffer, so we can assume that all post-processing is turned off (see below)"
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2019-11-21, 14:45:03
Reply #9

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
So this is really related to the way Corona's tone mapping works when converting from its internal linear Wide RGB to sRGB. If you right-click on the reddish area, you will see that originally there was a negative value for green component. The inverse of green is red, so in the end, red will be added. I can perfectly understand that this may be confusing and may be unexpected and we will rework this in the future. But on the other hand, this is one of the reasons people are saying that Corona's "light" or "light simulation" is better (more realistic) than other renderers'.
 
To "fix" this, you can for example use LUTs, which will make brightest areas desaturated (white), which is desired if you compare 3D rendering to photography.
Another idea is to decrease saturation just a tiny bit.
And another is to use highlight clamping (not highlight compression!). Setting it to a low value will clamp the light's color to show blue values only. This will be however probably too strong to use it in production (it will clamp too heavily).

I am adding a simplified version of the scene where most other things are disabled or removed (for example there was a white light in the scene, which could have affected the final colors).

There is also one bug related to this, which you may soon discover: if you have colors with high negative values in the scene (as a result of using negative HDR values in Corona Color map or when using refraction color or absorption), and if you save such rendering, you will see that the colors are different and there is even a chance that some artifacts will appear. We have this logged in our internal bug tracker.

I will also try to get one of our developers to provide a better, more detailed technical explanation of what exactly is going on here.

Update: without this feature, renders like this, where lights have extremely saturated colors, would not be possible: https://forum.corona-renderer.com/index.php?topic=999.msg12816#msg12816

Also, just to clarify:
- Refraction color is like a filter color applied to the surface of the whole object, uniformly. Absorption color is what color white light becomes after traveling specific distance. Absorption makes thin parts colorless, and thicker parts saturated.
- Physical and simple exposure controls are doing the same thing, affecting how bright the rendering is. There is no difference between them in terms of realism or colors. 3ds Max controls like automatic exposure are ignored.
« Last Edit: 2019-11-21, 14:58:15 by maru »
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-11-21, 16:08:14
Reply #10

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
To "fix" this, you can for example use LUTs, which will make brightest areas desaturated (white), which is desired if you compare 3D rendering to photography.
Another idea is to decrease saturation just a tiny bit.

This. I have started to use LUTs (the photographic ones) after discovering that I can't get close to photography with the tone mapper alone. On any project I start to work on now, the first thing I do is to enable one of the photographic LUTs and go from there.

The topic reminds me of a discussion on plates from ARRI and RED cameras some years back, where color space conversions needed to be crazily delicate for certain colors not to blow up. I remember one issue was that bright white would turn cyan in a workflow that worked otherwise, and the postproduction had to come up with custom solutions because digital cameras worked differently from scanned material... obviously. I see this from time to time even on big shows... the thing is if you don't know it you don't notice.

Is the issue at hand only present in v5? And is this really something that plays a role in normal lighting/output situation or only with high exposures?

2019-11-21, 18:37:41
Reply #11

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
Is the issue at hand only present in v5? And is this really something that plays a role in normal lighting/output situation or only with high exposures?
Nope, it's been there since alphas or maybe some of the first versions.
It happens with things like high exposure, refraction color, absorption color, colors with negative HDR values. So probably not often encountered in "standard" cases.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-11-21, 20:48:00
Reply #12

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
So this is really related to the way Corona's tone mapping works when converting from its internal linear Wide RGB to sRGB. If you right-click on the reddish area, you will see that originally there was a negative value for green component. The inverse of green is red, so in the end, red will be added. I can perfectly understand that this may be confusing and may be unexpected and we will rework this in the future. But on the other hand, this is one of the reasons people are saying that Corona's "light" or "light simulation" is better (more realistic) than other renderers'.
 
To "fix" this, you can for example use LUTs, which will make brightest areas desaturated (white), which is desired if you compare 3D rendering to photography.
Another idea is to decrease saturation just a tiny bit.
And another is to use highlight clamping (not highlight compression!). Setting it to a low value will clamp the light's color to show blue values only. This will be however probably too strong to use it in production (it will clamp too heavily).

I am adding a simplified version of the scene where most other things are disabled or removed (for example there was a white light in the scene, which could have affected the final colors).

There is also one bug related to this, which you may soon discover: if you have colors with high negative values in the scene (as a result of using negative HDR values in Corona Color map or when using refraction color or absorption), and if you save such rendering, you will see that the colors are different and there is even a chance that some artifacts will appear. We have this logged in our internal bug tracker.

I will also try to get one of our developers to provide a better, more detailed technical explanation of what exactly is going on here.

Update: without this feature, renders like this, where lights have extremely saturated colors, would not be possible: https://forum.corona-renderer.com/index.php?topic=999.msg12816#msg12816

Also, just to clarify:
- Refraction color is like a filter color applied to the surface of the whole object, uniformly. Absorption color is what color white light becomes after traveling specific distance. Absorption makes thin parts colorless, and thicker parts saturated.
- Physical and simple exposure controls are doing the same thing, affecting how bright the rendering is. There is no difference between them in terms of realism or colors. 3ds Max controls like automatic exposure are ignored.

OK, so your last attached image is how things should look!

What I don't comprehend is:

  • Why is there a non-zero value for red in the Tonemapped sRGB when there was no Red component to begin with?
  • Why is the green value negative if it started out as 0 (for the light source) and a small positive value (for the glass the light source is shining through/being refracted by)

In other words, how do you get a non-zero R value at all (0-255 or floating point, tone mapped or not) when there is no red in the scene?
How does a green color contribution from refraction all of a sudden become a negative "Original Linear RGB" value?
« Last Edit: 2019-11-21, 21:01:36 by SharpEars »

2019-11-21, 20:49:34
Reply #13

SharpEars

  • Active Users
  • **
  • Posts: 103
    • View Profile
Is someone looking into this?

Bump...

Your camera is using Simple EV exposure despite your on/off VFB settings and your 3ds max auto-exposure from environment and effects. Please revert to Photographic ISO for more natural color correction and balanced exposure.

 Also when playing with color as absolute values I would suggest attaching a CoronaColor map and set to HDR solid color. Regarding the redness and the exposure seems to be directly related on the coloration of the refraction channel of the glass material, going for normal white doesn't affect the outcome, which I am guessing is due to some color absorption issues?

Will check on the 3ds max auto-exposure setting from environment/effect as you suggested, but AFAIK everything is turned off or inapplicable to this scene.

I thought the whole point of setting the Corona camera to "Simple EV" was not to deal with ISO/shutter-speed/aperture when motion blur and depth of field effects are not needed (i.e., use the equivalent of a still "pinhole" camera giving infinite Depth Of Field with no aperture size impact, only one scene is being rendered - no motion blur based on shutter speed, ISO is not relevant [in combination with shutter speed/aperture], because the EV value alone controls scene exposure).
Additional note: Setting the camera to use "ISO/Shutter speed/Aperture" instead of "Simple EV" will still cause the problem to be visible. Give it a try, after matching exposure with the Simple EV setting shown!

With regard to possible "absorption issues" stemming from the glass material, I don't buy it! There is zero RED component anywhere in this material. Please take a good look at its definition in 3ds max and tell me where you see any RED.

Finally, with regard to Corona's internal use of a/the "Wide RGB" color space, if this is the culprit then it is not being correctly mapped to the colors being displayed in Corona's own VFB window.

Please check screenshots, the reason I've mentioned absorption. Personally I've always avoided using color for refraction channel it's really unreliable and it always produced strange render results whilst it was in mental_ray, V_ray, Corona, or red-shift. Going for fog color or, absorption/translucency always gave me better results. But maybe that's just me :).

Yeah I realize that altering exposure for Photographic ISO would eventually bring you back to the initial redness issue I just mentioned it because the simple EV exposure overrides the VFB, regarding: "When I turn off all Corona post-processing, the image looks identical in the Corona frame buffer, so we can assume that all post-processing is turned off (see below)"

Just so you realize that your absorption example still shows incorrect "redenning" as you examine the images from left to right. It is much more difficult to see with a white background, though.

2019-11-22, 11:17:34
Reply #14

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
The detailed explanation is up to our developers, since I lack the knowledge to explain it. I have logged this "issue" as (Internal ID=426329039) and will share the explanation here as soon as it is provided.
Meanwhile, you can use the "notify" button at the top of this page to be notified by email about any updates in this thread.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us