A video showing how to setup lentil in Maya. The scene file is provided at the bottom of the page.
The bidirectional component runs after the light integration has already been completed. When looping over all the samples at the filtering stage, it detects high intensity samples with a luminance exceeding param: bidir_min_luminance. When one of these high intensity samples is found, it will re-integrate its energy over many rays shot backwards through the lens.
Select your camera's shape node. In the attribute editor under the Arnold tab, switch the
Camera Type to
Set the bidirectional sample multiplier param: bidir_sample_mult. The bokeh samples are decoupled from the AA sample count. A good interactive baseline is around
1-5, although you might want to increase this when dealing with very small highlights, or decrease it when dealing with larger high luminance areas. Lentil will automatically modulate the sample count based on the screenspace area footprint of the bokeh.
Set the minimum luminance a sample needs to have to be re-integrated using param: bidir_min_luminance. Luminance equals
r*0.21 + g*0.71 + b*0.072. A good baseline is around
1.0. If you are dealing with large high-luminance areas, which would not contribute much to the bokeh, you can raise this number to save rendertime.
In the operator section of the render settings, add a
lentil_operator. This operator will swap the filter for each AOV at rendertime.
In the render settings window, under the Imager section, create an
aiLentilImager. This will allow feeding back the bidirectionally sampled result into the renderview.
lentil_imagerneeds to be the first imager in the imager stack. It cannot accept inputs from other imagers, unlike the default arnold imagers.
A debug mode is provided to check which samples are going to be triggering the bidirectional sampling. Enable it with the
bidir_debug parameter in the camera settings. Make sure you adjust param: bidir_min_luminance to keep the white area around the highlights. Supersampling large diffuse areas is simply a waste of time.
The bidirectional sampling only kicks into action when:
lentil_operatorhas been added.
aiLentilImagerhas been added.