Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => Topic started by: Tom on 2023-07-03, 08:57:57

Title: Environment lighting discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-03, 08:57:57
Hi,

I rendered the same scene with Corona 9 and Corona 10 and saw a massive difference in the render in term of lighting.
The scene is lit by an HDRI and there's a real difference in the rendering of the shadows: they are sharp in Corona 9, and blurred in Corona 10. So basically all the lighting rendering changed from Corona 9 to Corona 10. It's as if there was a Gamma correction applied to the map in Corona 10.

Here are some crop renders showing you the issue, and the HDRI settings:
Title: Re: Discrepancy between Corona 9 and 10
Post by: Aram Avetisyan on 2023-07-03, 15:18:06
Hi,

Do you have ACES OT operator in the Tone mapping?
If yes, please try disabling it and see if the results are identical.
Title: Re: Discrepancy between Corona 9 and 10
Post by: dfcorona on 2023-07-03, 18:00:33
I've seen many reports of this, renders looking quite different.
Title: Re: Discrepancy between Corona 9 and 10
Post by: maru on 2023-07-03, 18:05:57
Are you using Corona Sky with clouds enabled in this scene?
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 08:50:48
Hi,

Do you have ACES OT operator in the Tone mapping?

No I don't.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 08:54:38
I've seen many reports of this, renders looking quite different.

Really? That's interesting. I found Corona 10 new features being pretty awesome, particularly additional outputs in maps and the new lister, these are really cool, but in this particular scene I had to lower the gama of the HDRI by around 15% in order to obtain pretty similar results to Corona 9, which to me is not "quite different" but drastically different. So in the end, I may have to roll back to Corona 9 until a fix is released.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 08:55:25
Are you using Corona Sky with clouds enabled in this scene?

No: only an HDRI map in the 'single map' slot of Corona's Scene Environment settings
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 09:01:27
It's worth mentioning that Corona 10 seems slower to render than Corona 9, at least in certain situations like this one: https://forum.corona-renderer.com/index.php?topic=40359.0;all
Title: Re: Discrepancy between Corona 9 and 10
Post by: Aram Avetisyan on 2023-07-04, 09:27:49
Hi,

Please attach the scene archive (or a simplified version of it), if possible, for us to have a look.
The renders should not look different between v9 and V10.

The best thing, of course, will be to send a ticket to us at: https://support.chaos.com/hc/en-us/requests/new
and attache the scene there. This way everything will be tracked better.
Title: Re: Discrepancy between Corona 9 and 10
Post by: romullus on 2023-07-04, 10:05:32
Really? That's interesting. I found Corona 10 new features being pretty awesome, particularly additional outputs in maps and the new lister, these are really cool, but in this particular scene I had to lower the gama of the HDRI by around 15% in order to obtain pretty similar results to Corona 9, which to me is not "quite different" but drastically different. So in the end, I may have to roll back to Corona 9 until a fix is released.

Messing with the gamma is arguably one of the worst things you can do with environmental HDRI, no wonder why your renders are different in Corona 9 vs 10
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 10:25:56
Hi,

Please attach the scene archive (or a simplified version of it), if possible, for us to have a look.
The renders should not look different between v9 and V10.

The best thing, of course, will be to send a ticket to us at: https://support.chaos.com/hc/en-us/requests/new
and attache the scene there. This way everything will be tracked better.

Thanks. I just opened a ticket and sent the scene.
Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-04, 11:19:30
Really? That's interesting. I found Corona 10 new features being pretty awesome, particularly additional outputs in maps and the new lister, these are really cool, but in this particular scene I had to lower the gama of the HDRI by around 15% in order to obtain pretty similar results to Corona 9, which to me is not "quite different" but drastically different. So in the end, I may have to roll back to Corona 9 until a fix is released.

Messing with the gamma is arguably one of the worst things you can do with environmental HDRI, no wonder why your renders are different in Corona 9 vs 10

He means he had to adjust the HDRI gamma in order to make the renders match between 9 and 10.  So in V9, the HDRI at default gamma settings gives render A, in V10, the HDRI at default gamma settings gives Render B.  This is where the difference is.  To make Render B match Render A, he had to adjust gamma of HDRI.

Edit:  I think.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 11:32:27
@dj_buckley: thanks, you're absolutely right. This is what I meant.
Title: Re: Discrepancy between Corona 9 and 10
Post by: romullus on 2023-07-04, 12:14:08
Changing HDRI gamma would explain the difference in shadows in the first post. I find it hard to believe that with default gamma V9 and V10 would produce such vastly different results. Anyway, now that the scene is in the hands of support team, i'm sure we'll soon hear what's the real issue here.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-04, 12:20:52
Changing HDRI gamma would explain the difference in shadows in the first post. I find it hard to believe that with default gamma V9 and V10 would produce such vastly different results. Anyway, now that the scene is in the hands of support team, i'm sure we'll soon hear what's the real issue here.

Just to clarify: I didn't change the HDRI gamma. I used the exact same scene with same settings. But, as you can see in the SME screenshot, a color correction is applied to the HDRI. And this color correction remained exactly the same in both renders, hence I'm surprised of the difference.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Aram Avetisyan on 2023-07-04, 14:35:44
The case is already being handled in the ticket, the difference between the renders is confirmed.
It has something to do with CoronaColorCorrect map, plugging the HDRI directly in to the Environment slot(s) gives identical renders for V9 and V10.

I will share other important updates here.
Title: Re: Discrepancy between Corona 9 and 10
Post by: pokoy on 2023-07-04, 19:06:43
Oh, if ColorCorrect node produces different results with HDR images, then that's pretty much a 'no' for using v10 for me. Using it in almost every scene over here. Sounds like something for a hotfix.
Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-04, 19:17:28
Oh, if ColorCorrect node produces different results with HDR images, then that's pretty much a 'no' for using v10 for me. Using it in almost every scene over here. Sounds like something for a hotfix.

Same :(
Title: Re: Discrepancy between Corona 9 and 10
Post by: Aram Avetisyan on 2023-07-13, 09:44:45
Here are the updates for this:

The environment map filtering has been improved in Corona 10, and with some specific maps and resolutions the renders may look different.
As observed by Tom, there is no difference when using a 20k map and there is difference when using a 7k map (different maps).

If this is the case of any user, to have identical with Corona 9 renders while using Corona 10, a string option (https://support.chaos.com/hc/en-us/articles/4528609584017-String-options-) can be used to increase the environment map's lighting resolution (default value is 1000):

Code: [Select]
int lights.envResolution = 5000
This should give identical results between Corona 9 and Corona 10.

Feel free to test this out and share your feedback.

Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-13, 10:03:21
Seems like a key change that should be documented somewhere.

I'm not technical so I don't fully understand that string, but is Corona ultimately reducing the resolution of HDRI's behind the scenes?
Title: Re: Discrepancy between Corona 9 and 10
Post by: romullus on 2023-07-13, 11:23:46
Seems like a key change that should be documented somewhere.

Totally agree, especially since it gives such a radically different result by default. I for one, almost never use higher than 4K HDRI for environment and i'm bit worried now that my old scenes will look quite different now, on the other hand 90% of my environment lighting is done with Corona sun and sky, so maybe i will be good :]
Title: Re: Discrepancy between Corona 9 and 10
Post by: pokoy on 2023-07-13, 11:48:45
Here are the updates for this:

The environment map filtering has been improved in Corona 10, and with some specific maps and resolutions the renders may look different.
As observed by Tom, there is no difference when using a 20k map and there is difference when using a 7k map (different maps).

If this is the case of any user, to have identical with Corona 9 renders while using Corona 10, a string option (https://support.chaos.com/hc/en-us/articles/4528609584017-String-options-) can be used to increase the environment map's lighting resolution (default value is 1000):

Code: [Select]
int lights.envResolution = 5000
This should give identical results between Corona 9 and Corona 10.

Feel free to test this out and share your feedback.

I'm sorry but in my opinion it's never a good idea to change things like this. And it would be critical to know what 'specific maps' means and which resolutions will be downgraded to which values. Also, a default of 1000 pixels might be a bit too low.

Why wasn't this mentioned anywhere? And, why was it changed in the first place?
Title: Re: Discrepancy between Corona 9 and 10
Post by: Juraj on 2023-07-13, 12:39:48
I am interested which one is closer to ground truth? Since in above post it is being mentioned that at 20K, difference isn't observed (and how come if they are both downsampled apparently to just 1K behind the scenes?), what happens at that 20K? Does it look like in V9 or like in V10?

What is correct?

Title: Re: Discrepancy between Corona 9 and 10
Post by: arqrenderz on 2023-07-13, 15:22:13
Resolution or filter type shouldn't change image color don't it ???
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-14, 05:32:56
Hi guys,

First thing to mention is I tried the string trick and I confirm Corona 10 now gives similar results to Corona 9, that's a good point as we now have a workaround, although not really user friendly.

To clarify and summarize: when using a 7k HDRi map without using the 'string trick,' I found a significant difference between Corona 9 and Corona 10. This difference no longer exists when employing the 'string trick.' As I was curious to know if this discrepancy was due to the HDRi map itself, I repeated the test, this time using another HDRi map, of a higher resolution of 20k. And surprinsingly I did not observe any notable difference, even without using the 'string trick.' Therefore, I don't quite understand how the new filtering in Corona 10 works, and I would appreciate feedback from the developers on this matter, as well as a fix to achieve shadows as sharp as those in Corona 9 without having to rely on the 'string trick.'
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-14, 05:36:14
Here is the conversation I had with Aram replying to my support ticket, in case it helps:

>     
>
> Aram Avetisyan (Chaos)
>

> I understand what you are addressing, but keep in mind that the filtering has been improved for environment maps, so consider the results with Corona 10 as "superior" now, even though they differ from Corona 9.

What do you mean by "superior"? All I can see is less light being cast by the HDRi and blurrier shadows which to me looks like the opposite of a superior result.

> The "fix" for this already implemented - the better filtering - which comes with a drawback of possible differences between Corona 9 and Corona 10.

What was wrong with Corona 9 filtering? I still don't understand, sorry. If the goal was to speed up the rendering, I understand that, but not at the expense of a regression in shadow rendering and lighting intensity (both of which being linked obviously).

> And there is a workaround, I would say rather easy one, the string option, to get consistent with Corona 9 results using Corona 10.

Yes there is a workaroud, but it's far from user friendly.

> I have just in case asked clarifying questions for devs to see how exactly the resolution of a map affects the filtering, and I will update you once there is a response.

Great, thanks Aram.
Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-14, 09:53:55
So the better filtering makes the image look inferior but we have to think of it as superior.  Got it
Title: Re: Discrepancy between Corona 9 and 10
Post by: Juraj on 2023-07-14, 10:05:53
Internally downsampling to 1K might be little too much, since I create HDRis, I know how tiny the Sun is even at 25k + res.

Will do my own tests to check as well now.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-14, 10:48:14
Will do my own tests to check as well now.

Awesome. Thanks Juraj.
Title: Re: Discrepancy between Corona 9 and 10
Post by: pokoy on 2023-07-14, 10:54:34
Some rough (and probably wrong) math:
- sun disc diameter is 0.5° in visible sky, which translates to 1 pixel in a HDR @ 720px width (well, it's rectangular, not circular so obviously not enough resolution to properly represent a sun disc)
- when a low res HDR gets downsized to 1000px internally, we end up with a sun disc size of ~1.4 pixels (still not enough)
- with the original disc being downsized and filtered we may end up with a disc of around 3-4 pixels depending on its original intensity, hence the softer shadow and reduced intensity

Now that we know that the downsizing (and different lighting outcome) happens at some resolution below 20.000px it would be interesting to know:
- where is the threshold where env maps are being downsized
- are they downsized in steps (any other internal auto-values than 1000px?)

Once a scene is loaded that uses an environment map at a value that gets auto-downsized by v10, you absolutely MUST display a warning in the log window and offer an option to add the string from there. Earlier Corona versions had warnings in less severe cases where differences were to be expected so why not this time? Basically, let me decide if I want the 'new' or 'old/legacy' way of how env maps are treated.

In past versions, some features were deemed 'experimental' and were disabled by default and you enabled them only after it was shown to be safe to do so. The main reason for doing this was to ensure that images don't render differently. Now, you've implemented a change without communicating it, no info when opening a scene in v10 that *will* look differently and support says the workaround is an 'easy one'. I wonder if anyone spend enough time on thinking through the outcome of the change.
Title: Re: Discrepancy between Corona 9 and 10
Post by: Aram Avetisyan on 2023-07-14, 11:01:51
So the better filtering makes the image look inferior but we have to think of it as superior.  Got it

The new filtering technically gives closer look to the original HDRI used, the image looking inferior or superior is subjective here.

This smaller version is used for sampling the map (mostly for diffuse/mildly glossy surface). The original map is still used for highly glossy reflection/refraction/direct view.
Computing the map is expensive, that's why the lower resolution is used, to avoid high parsing times.

Previously the filtering was nearest-neighbor. Now it is linear. Sampling this way should better resemble the original, and it should also be able to sample more accurately.
The problem is with maps that have sun baked in it, which might have appeared as just one pixel (or not at all). This would lead to sharper shadows or missing shadows.
Now the sun is filtered, so the shadows are always there - but they may bet blurry.

This is a preparatory step for a bigger master task to be implemented in the future.

Using the string option will be the easiest fix here. Otherwise the decision about reverting back to previous filtering and waiting until the master task is complete and implemented should be discussed.
Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-14, 11:08:08
It's not subjective though.  The user has spent time fine tuning his scene and getting the image to look as it did in V9, now he's rendered it in V10 and it looks completely different.  So now it no longer looks like how the user wanted it to look, which means it's inferior to his original setup.

The fact is you can't just change something behind the scenes that will fundamentally change the look of our work in a very significant way and not tell us about it.  And then when we discover it, expect us to be cool with it because it saves some parsing time.

If it's a 'prep step' and not the final goal, then it should absolutely be listed as experimental and come with a warning, because it's basically an incomplete feature.
Title: Re: Discrepancy between Corona 9 and 10
Post by: maru on 2023-07-14, 11:14:44
Hi all,

We understand your concerns, so we will address this issue ASAP. There is currently an ongoing discussion how to do it best.

Q1: Why was this change made? Why didn't we communicate it? Why isn't there a legacy switch?
A1: It was meant to be an improvement happening purely under the hood and it was not supposed to change the appearance of the rendered images.

Q2: Why is this changing the appearance of the rendered images?
A2: This is something we missed during our internal tests. Also, please note that no other users reported this to us during the daily / RC stage and we haven't encountered this issue when creating our internal scenes for testing new features, new versions, and presenting new features in the knowledge base/documentation portal.

The automatic downsizing of the environment map (for non-sharp reflections) has always been there (since alpha versions of Corona). We just changed the filtering method for the downsizing from nearest neighbor to linear filtering.

Currently, to revert to the original behavior, you can use a string option:
First, enable the development/experimental stuff rollout - https://support.chaos.com/hc/en-us/articles/4528523195537
Then, go to Render Setup > Performance > String options - https://support.chaos.com/hc/en-us/articles/4528609584017

And then, enter this line into the string options text field:
Code: [Select]
int lights.envResolution = 5000
If you wish to revert to the default V10 behavior, use
Code: [Select]
int lights.envResolution = 1000
 
Title: Re: Discrepancy between Corona 9 and 10
Post by: dj_buckley on 2023-07-14, 11:18:51
Thanks Maru

Personally I think the best way to address it would be getting it in a hotfix asap, moving it to experimental and letting the user choose which way they want it, but it should default to V9 behaviour.
Title: Re: Discrepancy between Corona 9 and 10
Post by: alexyork on 2023-07-14, 14:05:26
Thanks Maru

Personally I think the best way to address it would be getting it in a hotfix asap, moving it to experimental and letting the user choose which way they want it, but it should default to V9 behaviour.

This should be the way, surely. New scenes made in C10 could be the new way, older scenes should load in the old way. Renders shouldn't look visually different to this degree between major versions. Especially not if there's no warning popup (like was done with the "new" bloom+glare etc.) where at least you have a choice when you open a file made in C9 or older and can "upgrade" it knowing there will be differences.
Title: Re: Discrepancy between Corona 9 and 10
Post by: rowmanns on 2023-07-14, 14:45:16
Hi,

Will be addressed in the upcoming HF. Please bare with us.

Cheers,

Rowan
Title: Re: Discrepancy between Corona 9 and 10
Post by: Deckard on 2023-07-20, 08:56:31
I just noticed this discrepancy in one of my scenes and was just about to report it when I found this thread.
Attaching a comparison image for reference. The string fix seems to work, but a quick hotfix is certainly needed.
Title: Re: Environment lighting discrepancy between Corona 9 and 10
Post by: TomG on 2023-07-25, 14:06:31
Hotfix 1 is out which addresses this issue. https://forum.corona-renderer.com/index.php?topic=40587.0 or straight to https://corona-renderer.com/download.
Title: Re: Environment lighting discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-25, 14:22:02
Thanks a lot guys 👍🏻
Title: Re: Environment lighting discrepancy between Corona 9 and 10
Post by: maru on 2023-07-25, 14:22:46
Thank YOU for reporting it! 💪
Title: Re: Environment lighting discrepancy between Corona 9 and 10
Post by: romullus on 2023-07-25, 14:49:43
Quote
Added legacy checkbox (in Developmental/Experimental Stuff settings) to return to the pre Version 10 filtering of environment maps. This is on by default for legacy scenes.

I would prefer this to be on for all scenes, unless new filtering brings significant performance gains. Looking at all those comparisons, Corona 10 looks inferior, IMHO.[/list]
Title: Re: Environment lighting discrepancy between Corona 9 and 10
Post by: Tom on 2023-07-26, 01:58:34
I would prefer this to be on for all scenes, unless new filtering brings significant performance gains. Looking at all those comparisons, Corona 10 looks inferior, IMHO.[/list]

My bad, I read it too fast and thought the new filtering was off by default.
I agree 100%: what's the point in activating by default an option that gives worse results?