Author Topic: Denoising causes NaN Pixels to turn into bigger black squares  (Read 8529 times)

2016-06-08, 11:07:21

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
Corona 1.4
I let a render run overnight in DR mode with one additional DR machine. During the test it looked good but the final render showed a few small black areas and when inspecting the pixel values the tool displayed -nan(ind) in the original RGB values. They would've been easy to retouch in post, however after stopping the render the small areas turned into much bigger black squares which display 0/0/0 as mapped RGB values. So it ended up to be completely unusable, unfortunately I only have the state after the rendering was stopped, image is attached. When zoomed in, you can see jagged borders two sides, maybe it's useful information. Adaptivity was on, denoising too.

Is this caused by denoising? Why would a NaN pixel turn into a square?
« Last Edit: 2016-06-08, 12:07:01 by pokoy »

2016-06-08, 12:06:21
Reply #1

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
I was able to reproduce it and it happens during the Denoising calculation stage.

So apparently denoiser works in square chunks (52x52 pixels it seems) and a single NaN pixel will cause the whole chunk to turn black, making it impossible to retouch in post. This should be fixed in a way so NaN pixels are not taken into consideration or better filled with an average color based on the neighbor pixels before denoising does its job.

2016-06-08, 12:25:37
Reply #2

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
Not a number Pixels should never ever happen in the first place. It makes no sense to bandaid a rare occurrence of the renderer delivering badly formatted floats.
Since you can recreate this, do post it on Mantis (https://corona-renderer.com/bugs) with instructions or scene file to recreate.
Nan pixels being returned is the renderer failing at the very thing it was suppsed to produce... Pixels :D  Such a heavy bug has top priority in fixing.
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-06-08, 12:31:24
Reply #3

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
Not a number Pixels should never ever happen in the first place. It makes no sense to bandaid a rare occurrence of the renderer delivering badly formatted floats.
Since you can recreate this, do post it on Mantis (https://corona-renderer.com/bugs) with instructions or scene file to recreate.
Nan pixels being returned is the renderer failing at the very thing it was suppsed to produce... Pixels :D  Such a heavy bug has top priority in fixing.
While I agree with you I'd rather like to see a patch kind of fix since the possibility of a NaN pixel will remain.

2016-06-08, 13:06:25
Reply #4

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
Ultimately it is the dev's decision, but NaN should never ever happen. If something is unsupported it should return Red, but a NaN error is a fringe condition nobody checked and is not picked up by any exeption in the code, that flags it as unsupported. A major major fault.
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-06-10, 17:00:25
Reply #5

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Fixing NaNs is easy, can I have the scene?
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-06-10, 17:07:26
Reply #6

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
I'd like to see if I can strip the materials/textures from it and if it still produces NaNs. But generally, yes, it's just my personal stuff.
Is there a way for a private upload?

2016-06-10, 17:08:39
Reply #7

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Of course, same as always: https://corona-renderer.com/upload/
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-06-10, 20:02:52
Reply #8

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
With simple grey material override there are no NaN pixels. I have two other suspects and want to try these first, if this works, fine, if not I'll supply the scene. If you want I can supply it anyways but with some more tests I may have some hints on what causes this.

As for the original question, shouldn't Denoising be improved to handle cases like this, too?

2016-06-11, 14:08:31
Reply #9

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
no, its better to just prevent all NaNs ;)
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-06-13, 18:53:31
Reply #10

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
So I just tried to reproduce it - it was reproducible before - and it's not showing any NaNs anymore. The only thing I did in between was to uninstall Corona (to check how 2017 behaves because of the comma/dot issue) and install it again... scratching my head right now, not sure why this can affect rendering.

2016-06-14, 13:07:14
Reply #11

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
ok, if you ever come across NaNs again, please report it again
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-06-14, 13:44:58
Reply #12

alexyork

  • Active Users
  • **
  • Posts: 743
  • Partner at Recent Spaces
    • View Profile
    • RECENT SPACES
One thing to check - did you clear the frame buffer for each test render where NANs were showing? I've had this before. No matter what you change in the scene the NAN(s) will remain until you clear the buffer. I now always check Clear buffer before rendering for all renders. For me it's peace of mind...
Alex York
Partner
RECENT SPACES
recentspaces.com

2016-06-14, 13:48:20
Reply #13

pokoy

  • Active Users
  • **
  • Posts: 1989
    • View Profile
No, it was reproducible with fresh max session.
Thanks for the pointer, will keep that in mind.