Understanding Adaptive Lights


 

 

Introduction

 

Tomasz Wyszołmirski of Dabarti Studio, is a beta tester for V-Ray for 3ds Max and has been testing a new option called Adaptive Lights which should be available in service pack 5 of V-Ray. He wrote a blog post about it on their site showing how much faster the Adaptive Lights option can be.

 

 

But what is Adaptive Light? While raytracing does provide us with the most compelling and realistic way to render the way light works, the algorithm presents us with many challenges. A common issue are scenes which have a lot of lights. When V-Ray 3.0 came out we introduced a simple way to deal with this called Probabilistic Lights. In the upcoming service pack 5 of V-Ray 3 we will introduce an improved method called Adaptive Lights.

To better understand this, let us break down all the different methods for evaluating light sources at any shading point.

 

Full lighting

 

This is the way we would deal with many lights prior to version 3. In this method, for every ray hit, we would evaluate every light source. In scenes with 5 or 10 lights, that is generally not a problem. But in scenes with 100s or 1000s of lights, this can drastically slow down your rendering.
 

 

Probabilistic Lights

 

In this method, for every ray hit we randomly pick a small fixed number of lights. The default is 16 lights, in our examples for illustrative purposes we will assume this number is 5. This drastically reduces the number of calculations for the shaded point. Since the next ray picks another 5 lights, and we generally fire millions of rays, on average all the lights tend to be accounted for. Generally speaking, this method can be faster compared to the old method which took into account every light at every ray hit. However one disadvantage is that it may introduce additional noise in the image and may need more samples to clean up. Additionally, some shading points may be taking into account lights that are not visible or don’t contribute illumination to that area.
 

 

Adaptive Lights

 

This method builds on top of the probabilistic method but makes it smarter about the lights it selects for evaluation. It relies on the Light Cache pass. The Light Cache is generally used for Global Illumination, but it also gives V-Ray a good overview of what is actually happening in the scene. In the end, the result is such that instead of picking 5 random lights, we can pick 5 lights that are the most likely to affect the shaded point. This can help V-Ray achieve a cleaner solution faster.
 

 

To be clear, Probabilistic Lights was and may still be a more clever way to deal with a large number of lights in a raytraced render. In most of the cases where a large number of lights are used, it does very well. But by being a bit smarter about the selection of lights based on the Light Cache result, Adaptive Lights evaluation is generally better.

In the following example, we explore a large space with many dividers. We placed 168 lights in the scene. We compare Full, Probabilistic, and Adaptive light evaluation in 3 different conditions.

 

Low Lights

 

In the first test, we place the lights fairly low in the scene. Because of the walls in the scene, most of the lights have only an effect in the nearby area.

 

 

Mid Lights

 

We then raise the lights at a mid height where they have a greater influence on the surrounding areas.
 

 

High Lights

 

Lastly, we raise them to high enough that every light effects most of the scene.
 

 

All images are rendered to the same noise threshold so they have similar levels of noise. Here are the results of the test:
 

Scene Full Probabilistic Adaptive Probabilistic/Full Adaptive/Full Adaptive/Probabilistic
Low Lights 110s 166s 45s 150.91% 40.91% 27.11%
Mid Lights 56s 72s 25s 128.57% 44.64% 34.72%
High Lights 84s 43s 30s 51.19% 35.71% 69.77%

 


While the test is designed specifically to demonstrate the advantage of the newer Adaptive method, what it does show is that there are conditions where the Probabilistic method alone can in fact be a disadvantage due to the increased noise. At the same time, the Adaptive method consistently has good performance. Even in conditions where the Probabilistic method does well, the Adaptive method still improves the result and renders faster.

We urge you to visit Tomasz Wyszołmirski blog post for a look at his more comprehensive benchmark test of the Full vs Probabilistic vs Adaptive.

About the author

Christopher Nichols

Chris is a CG industry veteran and Director of Chaos Group Labs. He can also be heard regularly as the host of the CG Garage podcast which attracts 20,000 weekly listeners. With a background in both VFX and Design, Chris has worked for Gensler, Digital Domain, Imageworks and Method Studios. His credits include Maleficent, Oblivion and Tron: Legacy.