Author Topic: NaN pixels on CoronaSun disc  (Read 685 times)

2023-12-20, 15:20:25

Ingus

  • Users
  • *
  • Posts: 4
    • View Profile
Hi.

NaN pixels are generated on CoronaSun disc when saving as half float exr. Full float exr and cxr does not have this problem.

Corona VFB shows correct sun disc but when half-float EXR file is opened in Resolve and simple correction is applied (for example, lowered gain in Fusion tab) then corona sun disc will show as black/transparent circle. It still exists when final animation/image is exported from Resolve.

Software used: 3ds max 2019, Corona 10 (Build timestamp: Jun 20 2023 10:41:10), Resolve 18.6, Win 11
Similar problem in Affinity Photo, Photoshop, Fusion.

I attached 2 JPGs:
1.Half float EXR exported from Resolve as JPG (with lowered gain) - Not OK
2.Full float EXR exported from Resolve as JPG (with lowered gain) - OK

Attached half float and full float EXRs and simple 3ds max 2019 scene with Corona Sun and Camera. To reproduce the problem:
1. Render image with CoronaSun disc visible
2. Save as half-float and full-float EXR
3. Import file in Resolve
4. In Fusion Tab add Brightness/Contrast node and lower the gain (or do any other manipulation) 

This problem can be fixed in many other ways in post but maybe there is something under the hood that can be improved so no extra steps are needed. Using full-float EXRs as a fix is also not ideal because it takes up a lot more space. When rendering 2000+ and multiple elements it adds up fast.






2023-12-20, 16:37:34
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
I can't reproduce it with Corona 11. Could you try with that version as well? Maybe it's an already fixed bug.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-12-20, 16:42:02
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
Update: I can reproduce it in your scene in Corona 11. We will look into this, but I am afraid it may be expected. Do you specifically need the half float format?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-12-20, 16:55:30
Reply #3

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
Update 2: Same happens if you render an extremely bright material with Arnold. I guess we just discovered the difference between half-float and full-float EXR format. ;)
But I'll be sure to share further explanations here as soon as I have anything.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-12-20, 19:15:47
Reply #4

Ingus

  • Users
  • *
  • Posts: 4
    • View Profile
Thank you for fast reply!
Half-float is much more space friendly and it also meets our compositing needs. We do a lot of 1500+ frame animations and with all the elements it takes a lot of space. Smaller files also meanfaster load/export times in Resolve.


2023-12-21, 09:35:15
Reply #5

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
This is now reported and waiting for feedback from our devs. (Internal ID=1271197791)

There was also a similar issue discussed in 2014, but I can see some contrary opinions:
https://forum.corona-renderer.com/index.php?topic=3860.msg27702#msg27702

Ondra: "The problem is that 16bit is limited in the terms of maximal possible luminance - standard sun color is brighter than any finite value expressable as 16bit float."

but

Racoonart: "16 bit float exrs ("half float") save values between 65504.0 and  5.96^–8  (http://http.developer.nvidia.com/GPUGems/gpugems_ch26.html) . So "superwhites" wise, this is more than you'll probably ever need."
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-12-21, 11:19:27
Reply #6

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
Afaik this can happen with certain filter types and/or sharpening, for example in Terragen this happens with catmull rom used as the image reconstruction filter. Of course I can be totally wrong but it's worth a try to go with other filtering types and disabling sharpening if it's being used.

2024-01-10, 09:46:03
Reply #7

Ingus

  • Users
  • *
  • Posts: 4
    • View Profile
Thanks for help! Started to play around with settings and this was the simplest workaround I found:
Keep VFB tone mapping tab ON with only simple exposure enabled and set set to -1 (or even lower). No need to change any part of our workflow and no more NaNs on sun disc. 

2024-01-30, 14:59:37
Reply #8

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12768
  • Marcin
    • View Profile
The final message here (for now) is that the saving is done by 3ds Max and is outside of our control. We may be able to fix this when / if Corona is able to handle file saving.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us