Houdini 20.0 Nodes VOP nodes

Karma Physical Lens VOP node

A pre-made lens shader implementation with controls for most common lens shader effects, such as bokeh, chromatic aberrations, and tilt/shift.

On this page
Since 18.5

Overview

This is an “uber lens shader” for the Karma renderer, provided so you can easily add common camera effects without having to implement your own lens shader.

How to

To...Do this

Set up a Physical Lens node

  1. In a LOP network (such as /stage), set up the camera you want to render from.

  2. Next to the camera, create a Material Network node.

  3. Dive inside the Material Network and create a Karma Physical Lens node.

    Use the parameters on the Physical Lens node to set up effects.

  4. Go back up and select the camera node. Click the Karma tab.

    • Set the drop-down menu next to Use lens shader to “Set or create”, then turn on Use lens shader.

    • Set the drop-down menu next to Lens shader VOP to “Set or create”, then click the chooser icon next to the text field and use the chooser window to find and select the Physical Lens node you created.

  5. If you switch the scene viewer to look through the camera using Karma, it should render the scene using the Physical Lens shader you configured.

Rolling shutter

Rolling shutter is an effect of consumer-grade digital camera sensors. Unlike chemical film which is exposed “all at once”, in some digital sensors the controlling circuitry scans across the image (vertically or horizontally) very rapidly. This means different parts of the image are not captured at the exact same instant, which can cause distortion (such as wobble and skew) when capturing extremely fast or extremely brief subjects.

You can use the controls on the Shutter tab to simulate this effect (for example, to match existing digitally captured footage).

About time offset and time scale

The Time offset and Time scale parameters may be hard to understand.

  • In a lens shader, “time” is a value representing the current point in the shutter time (from 0.0, shutter opening, to 1.0, shutter closed).

  • Time offset is the base time, so if you have a time offset value of 0.5 and a time scale of 0, the image will have no motion blur as it will just display the state of all objects half way through the shutter period.

  • Time scale is how much randomness (blurriness) is added to the Time offset. In camera terms, time scale is how long the sensor is exposed to light.

  • You can use time offset to determine when in the shutter period the virtual camera sensor starts imaging, and time scale to determine how long it images for.

  • In terms of a rolling shutter, the time offset is the position of the gap in the shutter, and the time scale is the size of the gap.

Parameters

Bokeh

Bokeh Shape

A choice for what shape the bokeh should be: Circular, Polygonal (see Number of sides), or Texture Map (see Bokeh texture map).

Bokeh Texture Map

When Bokeh shape is “Texture map”, this is the path to the texture to use. The texture should contain a bright bokeh shape on a black background.

(The shader samples the texture based on its intensity using importance_remap, shaping the bokeh to the bright parts of the texture).

Number of Sides

When Bokeh shape is “Polygonal”, this is the number of sides the bokeh shape has. This value must be greater than 3.

Bokeh Rotation

Rotate the bokeh shape by this number of degrees.

Anisotropy

This is a value from -1.0 to 1.0 which controls the aspect ratio of the bokeh shape. Set this to 0 to get square (equal height and width) shapes. Negative fractions make the bokeh shape narrower than it is tall. Positive fractions make the bokeh shape shorter than it is wide.

Anisotropy Texture Map

A texture map to control anisotropy (see the Anisotropy parameter above) for each pixel. In the texture image, black represents -1.0 and white represents 1.0.

Lens distortion

Projection

Change the projection type of the lense.

Perspective creates a default view of the world in front of the camera. This type can capture the depth of different objects. Orthographic creates a view of the world in front of the camera. This type can`t capture the depth of the different objects. Polar creates a 3-dimensional panoramic view around the camera. You can use the result in a dome-shaped world, for example a sky. Cylindrical creates a 3-dimensional panoramic view similar to the Polar view. Here the shape, that is used to enclose the camera, is a cylinder instead of a sphere. Polar Stereographic projection is used if preserving the shape of small object on image plane is required. Polar Equidistant projection is used if preserving angular sizes of object on image plane is required. Polar Equisolid projection is used if preserving constant ration of solid angles in object and image spaces is required. Polar Orthographic projection is used if evenness of illumination through the entire image plane is required.

Type of Curvature

A type of curvature to distort the lens with: “None”, “Quadratic”, “Cubic”, or “Texture Map”.

Curvature Texture Map

When Curvature type is “Texture map”, this is a path to the texture map. Values in the texture image represent the unit “height” of the lens (distance from flat) at a given position across the face of the lens. Black represents -1.0 and white represents 1.0.

Lens Curvature

When Curvature type is not “None”, this is the amount of curvature to apply, from -1.0 to 1.0.

Chromatic Aberration

The amount of chromatic aberration to add to the lens.

This value plus one represents the index of refraction applied to blue light. The shader then linearly maps this value down to an index of refraction of 1.0 for red light. For example, a value of 0.2 means the index of refraction is 1.2 for blue light and 1.0 for red light, with a linear gradient in between.

For more control over the mapping use the Aberration ramp.

Aberration Ramp

This ramp controls the mapping of aberrations between blue and red light. The left edge of the ramp represents blue light and the right edge represents red light. The vertical axis represents the index of refraction and goes from 1.0 at the bottom to 1.0 + the value of Chromatic Aberration at the top.

Tint and Exposure

Tint

Adds a color tint to the output. You can use numbers greater than 1.0 to (unrealistically) brighten the image.

Tint Texture Map

Effectively multiplies this texture map over the output image.

Exposure

An exponential scale for the brightness of the image.

Intensity

A linear scale for the brightness of the image.

Vignetting

An amount to darken the image around the edges. Because this is physically based, it is relative to the camera’s field of view. Alternatively, you can use the Tint texture map to get full control over darkening parts of the image.

Tilt and Shift

Tilt X

The number of degrees to tilt the plane of focus by in the X direction (around the camera’s Y axis).

Tilt Y

The number of degrees to tilt the plane of focus by in the Y direction (around the camera’s X axis).

Shift X

The distance (in Houdini world units) to shift the lens in the X direction.

Shift Y

The distance (in Houdini world units) to shift the lens in the Y direction.

Focus Mapping

F-Stop Texture Map

The path to a texture map that specifies the f-stop value at each pixel. In the texture image, black represents F-stop near and white represents F-stop far.

F-Stop Near

The lower bound of the F-stop texture map.

F-Stop Far

The upper bound of the F-stop texture map.

Focus Texture Map

The path to a texture map that specifies the focus distance at each pixel. In the texture image, black represents Focus near and white represents Focus far.

Focus Near

The lower bound of the Focus Texture Map.

Focus Far

The upper bound of the Focus Texture Map.

Shutter

Rolling Shutter Direction

A choice for how to simulate rolling shutter: “None”, “Bottom First”, “Top First”, “Left First”, “Right First”, or “Custom” (see Time offset curve below).

Time Offset Ramp Rotation

When Rolling shutter is “Custom”, the direction of the shutter movement, in degrees. A value of 0 represents straight up (positive Y in camera space).

Time Offset Ramp

When Rolling shutter is “Custom”, this ramp to control the progression of the shutter across the image. See understanding time offset and scale above. The horizontal axis represents shutter time, the vertical axis represents shutter progress, where the bottom is the start position and the top is the end position. So, the default ramp (a line from bottom left to top right) represents a linear progression across the image.

Time Offset Texture Map

Path to a texture map file to control the time offset. See understanding time offset and scale above.

Time Scale

A base scale on the shutter time. Basically, this affects how blurry the image is, however see understanding time offset and scale above for more information. For rolling shutter effects time scale must be quite small, otherwise the rolling shutter will not be visible.

Time Scale Texture Map

Path to a texture map file to control the time offset. See understanding time offset and scale above.

Use Shutter Curve

Turn this on to get custom control over the amount of light allowed into the camera aperture across the shutter time.

Shutter Curve

When Use shutter ramp is on, the ramp represents the weighting of a time sample based on it’s position in the shutter period. In terms of a camera, this ramp represents how much light gets through to the sensor (vertical axis) at a given moment across the the shutter time (horizontal axis). The default distribution is uniform.

See also

VOP nodes