Page 1 of 1

problems with BACKGROUND

Posted: Tue May 11, 2021 7:45 am
by bartek_zgo
Hi Guys,
I have a problem with background image. It looks absolutely normal, but LuxCore doesn't like it. I've done tests with few scenes. In the attachment you will find the most simple scene I could create. It is a box. Inside a box I have a light source. I have a camera inside the box. So from theoretical point of view, as I'm inside closed space the environment should not change anything.
Without background image the render looks like this:
out.png
But when I set this texture as background the render is completely black, no matter how strong is the emitter. With some scenes I get segmentation fault. So in 100% the problem is with texture but I want to know why to not repeat the problem in the future.

Re: problems with BACKGROUND

Posted: Tue May 11, 2021 8:20 am
by Dade
The problem is triggered by the broken/corrupted HDR used for your infinite light source:

nan.jpg

As you see, it is full of NaN values. This cause a cascade of problems: building the importance sampling map will go horrible wrong, power base light strategy will not work, etc.

Re: problems with BACKGROUND

Posted: Tue May 11, 2021 10:43 am
by bartek_zgo
Thanks Date. Only one question. Why don't you check that while loading files? Maxwell, Photoshop open this files without any warning.

Re: problems with BACKGROUND

Posted: Tue May 11, 2021 12:17 pm
by bartek_zgo
There is still one problem. The original file is not corrupted. I add the file to the scene using path:

Code: Select all

scene.lights.73257_BACKGROUND.type = "infinite"
scene.lights.73257_BACKGROUND.gain = 31500 31500 31500
scene.lights.73257_BACKGROUND.temperature = -1
scene.lights.73257_BACKGROUND.temperature.normalize = 0
scene.lights.73257_BACKGROUND.visibility.indirect.diffuse.enable = 1
scene.lights.73257_BACKGROUND.visibility.indirect.glossy.enable = 1
scene.lights.73257_BACKGROUND.visibility.indirect.specular.enable = 1
scene.lights.73257_BACKGROUND.transformation = 0.9876884 -0.1564344 0 0 -0.1564344 -0.9876884 0 0 0 0 1 0 0 0 0 1
scene.lights.73257_BACKGROUND.file = "/mnt/nodeHDD1/cache/Texture/177/5186.exr"
scene.lights.73257_BACKGROUND.gamma = 0.9
scene.lights.73257_BACKGROUND.storage = "float"
scene.lights.73257_BACKGROUND.sampleupperhemisphereonly = 0
scene.lights.73257_BACKGROUND.visibilitymapcache.enable = 0
than I call renderEngine->Export(dirPath) to create a nice zip for you.
The interesting thing is that original file do NOT have any NaN. Initial pixels has some negative values but they are not NaNs. So it looks that values below 0 are converted into -NaN. Do you allow negative values?

In attachment you will find original image.

Re: problems with BACKGROUND

Posted: Wed May 12, 2021 1:56 pm
by Dade
bartek_zgo wrote: Tue May 11, 2021 12:17 pm The interesting thing is that original file do NOT have any NaN.
You original image doesn't have NaNs but have negative values:

negative.jpg

It is still stuff a light source can not emit. Use exrtools (i.e. exrdisplay in this case) to check .exr files; it is the reference ILM OpenEXR implementation.

Re: problems with BACKGROUND

Posted: Tue Jun 08, 2021 7:17 am
by bartek_zgo
Need more clarification. What values luxcore can support. What should be the way to fix broken pixels?
Are negative values supported or should I set them to 0?
If I found +Inf should I set Half.MaxValue?
If I found -Inf should I set Half.MinValue or 0?
If I found negative should I set 0 or I can leave them?
If I found NaN should I set 0, or there is a better practice?

Re: problems with BACKGROUND

Posted: Tue Jun 08, 2021 9:58 am
by Dade
bartek_zgo wrote: Tue Jun 08, 2021 7:17 am Are negative values supported or should I set them to 0?
No, it is light emission so set to 0.
bartek_zgo wrote: Tue Jun 08, 2021 7:17 am If I found +Inf should I set Half.MaxValue?
Again, you can not emit +Inf light however it is harder to fix this pixel. The best strategy probably to assign the max. value of all other non-Inf pixels.
bartek_zgo wrote: Tue Jun 08, 2021 7:17 am If I found -Inf should I set Half.MinValue or 0?
If I found negative should I set 0 or I can leave them?
If I found NaN should I set 0, or there is a better practice?
0, 0 and 0.

Re: problems with BACKGROUND

Posted: Tue Jun 08, 2021 11:00 am
by bartek_zgo
Thanks Dade. Very helpful.