Visibility driven sampling of env. light sources (aka portals without portals)

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Visibility driven sampling of env. light sources (aka portals without portals)

Post by Dade »

Introduction

Portals are a common solution for rendering infinite lights and sky (i.e. environment light sources) in interior renderings. However they are both cumbersome to setup and not particularly effective. I will use this scene setup as a test case during this post:
scene.jpg
A classic setup where a portal would be used.

Importance driven sampling of infinite lights

LuxCore already implements importance driven sampling. It will sample more the brighter zones of an infinite lights. This is particularly important for true HDR where the sun is just few pixel large:
luminance.jpg

Visibility driven sampling of infinite lights

The idea is to build an visibility map of the environment light source without the need of portals. This is done during the scene pre-processing, by tracing visibility paths of the light source form the camera.
The resulting visibility map in our test scene is:
visibility.jpg

Combining visibility and importance map

The 2 types of maps are merged to have both advantages:
merge.jpg
Test result

This is a 100 samples/pixel rendering without Visibility map (direct light only):
nomap.png
and this with Visibility+Importance map:
map.png
There is less noise in the bright spot and far less black pixels in the penumbra zones.

The difference is a bit less noticeable with full global illumination due to the general noise. Without map:
nomap-6-100.png
and with visibility map:
map-6-100.png
Sky light source

The visibility map can be used for Sky2 light source too.

New parameters

This is the list of new parameters for infinite and sky2 lights:

Code: Select all

# Default values
scene.lights.infinitelight.visibilitymap.enable = 1
scene.lights.infinitelight.visibilitymap.samples = 1000000
scene.lights.infinitelight.visibilitymap.width = 512
scene.lights.infinitelight.visibilitymap.height = 256
scene.lights.infinitelight.visibilitymap.maxdepth = 4
Casting 1,000,000 usually takes 1 seconds on my six cores. The default values should be pretty much ok for any scene.

NOTE: visibility map pre-processing is automatically disabled in RT modes for obvious reasons.

Conclusion

This (novel) method is already effective and the next step is a full light cache: there is currently a single map for the entire scene, the next step is to have many maps distributed of the all visible surfaces reduce the noise, not only of the env. lights, but of any type of light sources, direct or indirect.
Support LuxCoreRender project with salts and bounties
jensverwiebe
Supporting Users
Posts: 141
Joined: Tue Jan 09, 2018 6:48 pm

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by jensverwiebe »

Great stuff.

Jens
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by B.Y.O.B. »

Dade wrote: Wed Feb 07, 2018 4:00 pm This is the list of new parameters for infinite and sky2 lights:

Code: Select all

# Default values
scene.lights.infinitelight.visibilitymap.enable = 1
scene.lights.infinitelight.visibilitymap.samples = 1000000
scene.lights.infinitelight.visibilitymap.width = 512
scene.lights.infinitelight.visibilitymap.height = 256
scene.lights.infinitelight.visibilitymap.maxdepth = 4
A note for other exporter developers: "infinitelight" is the name of the light source here.
The visibilitymap.* parameters can be used on lights with type infinite and sky2 as far as I understand.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by Dade »

BTW, I noticed we have still Sky1 supported ... anyone can think to a good reason to keep that stuff ? I'm ready to kill it.
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by B.Y.O.B. »

In BlendLuxCore it is not even exposed.
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by Sharlybg »

Thanks for giving boost to theses rendering scenario ! I wish you all the best :D
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by B.Y.O.B. »

Do you plan to add support for this to constantinfinite light, too?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by Dade »

B.Y.O.B. wrote: Wed Feb 07, 2018 6:52 pm Do you plan to add support for this to constantinfinite light, too?
Yes, I can (I forgot it can useful there too).
Support LuxCoreRender project with salts and bounties
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by kintuX »

Simply :o GREAT!
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Visibility driven sampling of env. light sources (aka portals without portals)

Post by Sharlybg »

Compatibility with Bidir engine ?
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
Post Reply