problems with BACKGROUND

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

problems with BACKGROUND

Post 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.
Attachments
luxScene.zip
(3.09 MiB) Downloaded 119 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: problems with BACKGROUND

Post 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.
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: problems with BACKGROUND

Post 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.
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: problems with BACKGROUND

Post 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.
Attachments
5186.zip
(46.21 KiB) Downloaded 120 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: problems with BACKGROUND

Post 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.
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: problems with BACKGROUND

Post 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?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: problems with BACKGROUND

Post 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.
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: problems with BACKGROUND

Post by bartek_zgo »

Thanks Dade. Very helpful.
Post Reply