Page 1 of 2

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

Posted: Wed Feb 07, 2018 4:00 pm
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.

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

Posted: Wed Feb 07, 2018 4:06 pm
by jensverwiebe
Great stuff.

Jens

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

Posted: Wed Feb 07, 2018 4:13 pm
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.

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

Posted: Wed Feb 07, 2018 4:14 pm
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.

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

Posted: Wed Feb 07, 2018 4:15 pm
by B.Y.O.B.
In BlendLuxCore it is not even exposed.

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

Posted: Wed Feb 07, 2018 4:54 pm
by Sharlybg
Thanks for giving boost to theses rendering scenario ! I wish you all the best :D

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

Posted: Wed Feb 07, 2018 6:52 pm
by B.Y.O.B.
Do you plan to add support for this to constantinfinite light, too?

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

Posted: Wed Feb 07, 2018 8:03 pm
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).

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

Posted: Wed Feb 07, 2018 9:03 pm
by kintuX
Simply :o GREAT!

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

Posted: Wed Feb 07, 2018 11:46 pm
by Sharlybg
Compatibility with Bidir engine ?