Houdini workflow


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.


1. Create a Lentil camera

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.


2. Set up parameters in the camera attributes

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.


3. Add & connect the Lentil Imager

In the /out context, create an Arnold Imager Builder. Inside, add a lentil_imager node & connect to Imager Output node.

The next step is to link the imager inside the Arnold ROP. Simply put the path to the recently created lentil_imager.


4. Add the Lentil Operator

Add a lentil_operator node and connect it to the arnold ROP.


5. (optional) Double check the samples that will trigger the bidirectional component

A debug AOV lentil_debug is automatically created. The AOV will show the amount of bidirectional samples per pixel, with a closest filter.

RGBA You're going to waste time Excellent!

Final checklist

The bidirectional sampling only kicks into action when:

  • The AA samples are larger or equal to 3.
  • An imager of type: lentil_imager has been added & connected.
  • param: bidir_sample_mult is not 0.