Visibility driven sampling of env. light sources (aka portals without portals)
Posted: Wed Feb 07, 2018 4:00 pm
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:
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:
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:
Combining visibility and importance map
The 2 types of maps are merged to have both advantages:
Test result
This is a 100 samples/pixel rendering without Visibility map (direct light only):
and this with Visibility+Importance map:
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:
and with visibility map:
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:
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.
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:
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:
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:
Combining visibility and importance map
The 2 types of maps are merged to have both advantages:
Test result
This is a 100 samples/pixel rendering without Visibility map (direct light only):
and this with Visibility+Importance map:
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:
and with visibility map:
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
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.