A video showing how to setup lentil in Houdini. The scene file is provided at the bottom of the page. To download this file, use the link at the bottom of the page.
In the /shop context, create an
Arnold Shader Network. Inside, add either a
lentil_camera node. Create a
Camera Output node and connect. The automatically created
Material Output node can be removed.
The next step is to link the shader to a Houdini camera. In the /obj context, select your camera node. In the camera parameters, inside of the arnold submenu there's a parameter
Camera Shader. Enter the path to the shader there.
From here on, the parameters in the depth of field tab will not work any more. Instead, you need to control the parameters (focal length, focus distance, ...) on the
lentil_camera node in the /shop context.
Set the Units param: units. Set this to meters if you work in the default houdini scale (1unit=1meter). You can set this to centimeter if you consider 1 unit 1 centimeter, etc. Note that this is for internal conversion, e.g the focus_distance is always supplied in centimeters, even if the unit param would be set to M.
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-10, although you might want to increase this to
50-100 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.
In the /out context, create an
Arnold Imager Builder. Inside, add a
lentil_imager node & connect to
Imager Output node.
lentil_imagerneeds to be the first imager in the imager stack. It cannot accept inputs from other imagers, unlike the default arnold imagers.
The next step is to link the imager inside the Arnold ROP. Simply put the path to the recently created
A debug AOV
lentil_debug is automatically created. The AOV will show the amount of bidirectional samples per pixel, with a closest filter.
The bidirectional sampling only kicks into action when:
lentil_imagerhas been added & connected.