BlackBox and Light Leaking

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.
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

BlackBox and Light Leaking

Post by marcatore »

Since I started to use Luxcore (I really don't remember with Luxrender, in any case it's gone) I often saw light leaking in the corner of the rooms I used as environment.
I built a "blackbox", a room without windows with a camera inside. I've put a sun lamp outside.
The walls has no thickness.

And trying rendering this extreme scene the result is a black image (this is expected) with some bright spot, many of them gathered in the corner.
blackbox.jpg
I've tried the same scene in vray and the result is a black image without any bright pixels.

Is it a correct behaviour according to how Luxcore is programmed or not?
Could be the same "problem" that generate light leaks with PGI?

I've attached a simple scene.
Attachments
test_BlackBox.zip
(76.31 KiB) Downloaded 142 times
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: BlackBox and Light Leaking

Post by marcatore »

Playing with Eplison values trying to go lower, the gathering in the corner disappear but there are more bright pixels on the vertical walls.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: BlackBox and Light Leaking

Post by CodeHD »

Just today Dade has commented on this in the GI-cahce thread.

here is the post:
viewtopic.php?f=5&t=840&start=650#p10735

According to that, it is to be expected.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlackBox and Light Leaking

Post by Dade »

CodeHD wrote: Fri Mar 01, 2019 4:32 pm Just today Dade has commented on this in the GI-cahce thread.

here is the post:
viewtopic.php?f=5&t=840&start=650#p10735

According to that, it is to be expected.
Yup, wall must have thickness otherwise, first or later, you can have a light leak.
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: BlackBox and Light Leaking

Post by marcatore »

ok. But it's a standard behaviour for a path tracer?
Cycles, for example, renders a full black image.

Using thickness and overlapping geometries means more work when you have a "not cube" scene and it has less flexibility with modelling cause you have, for example, to rest a wall to the floor, so it's not just adding thickness.
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: BlackBox and Light Leaking

Post by marcatore »

I've tried to add thickness and it works.

But I've tried to use PGI (I know it's quite useless in this scene but I'd like to test anyway) and if you use a Lookup Radius lower o equal to the thickness I've added to the walls (ceiling and floor) Blender crashes.

As attached the scene modified.
Attachments
test_BlackBox.zip
(76.03 KiB) Downloaded 143 times
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: BlackBox and Light Leaking

Post by CodeHD »

marcatore wrote: Fri Mar 01, 2019 9:57 pm ok. But it's a standard behaviour for a path tracer?
Cycles, for example, renders a full black image.
I will leave the discussion of "standard" to someone else, but I would say "yes" anyways ;) The reason, as so often, are rounding errors.
What I imagine happens here is the following: A ray is launched from the camera, in some random direction within each pixel according to the sampler. Some of these hit one surface extremely close to the corner. A ray would then launched onwards from this point, in another random direction or towards the light source (shadow ray). The reason you get a leak is that the CPU has internally computed the intersection point with the plane at high precision, and then rounded it in such a way that the new starting point is outside your cube. With a 0-thickness wall, it then depends on coincidence if you get a leak.
Maybe there are other mechanisms as well, but rounding errors are always a possible problem in computer science.

Example in your scene: The rotation of the sun lamp. Set the y- and z-rotation to 0, then you do not get leaks for x-rotations between 94 and 266 degrees ;)

It is surely possible to program your intersection calculation in such a way that it includes sufficient margin for this situation. If that is something you want in terms of performance costs vs. how often this is really a problem in practise I can not judge.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlackBox and Light Leaking

Post by Dade »

marcatore wrote: Fri Mar 01, 2019 10:06 pm But I've tried to use PGI (I know it's quite useless in this scene but I'd like to test anyway) and if you use a Lookup Radius lower o equal to the thickness I've added to the walls (ceiling and floor) Blender crashes.
It exits writing a message error about the inability of Metropolis to find a useful light path. Indeed, there isn't one in a black room. I modified the code so it now renders black rooms too :mrgreen:
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: BlackBox and Light Leaking

Post by marcatore »

Did you already uploaded it?
I've downloaded the last build now and it crashes again.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: BlackBox and Light Leaking

Post by CodeHD »

Dade wrote: Fri Mar 01, 2019 5:25 pm Yup, wall must have thickness otherwise, first or later, you can have a light leak.
This is something that could be added to the FAQ
Post Reply