Houdini 21.0 Nodes VOP nodes

Karma Physical Lens Core VOP node

The stripped down version of the physical lens.

On this page
Since 19.0

Overview

This is the core version of the Karma Physical Lens node, which allows for powerful control over the core functionality of the full physical lens. It also provides an easier way to implement your own lens shader.

Intended usage

The physical lens core cannot act as a lens shader as is since it isn’t a CVEX shader. It’s intended usage is as a building block in a CVEX Shader Builder.

For an example of it’s usage place down a Karma Physical Lens node and set the “Allow Editing of Contents” option in the drop down menu. This will make it possible to see the insides of the node and see the Physical Lens Core in use.

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.

Parameters

Forwarded Coordinates

Use Forwarded Coords

A toggle to determine whether to use the forwarded coordinates forwarded_x and forwarded_y or to calculate them using the Karma inputs.

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.

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 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).

Tilt and Shift

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.

Inputs

Karma Lens Shader Inputs

ix

The pixel coordinate on the x axis.

iy

The pixel coordinate on the y axis.

seed

A seed value which is specific to the current pixel.

sampleindex

The number of times this pixel has been processed (sometimes known as pass index).

datawindow

The data window as a rectangle (in pixel coordinates, not NDC).

viewport

The camera window, as {xmin, xmax, ymin, ymax} in NDC (normalized device coordinates).

xres

The pixel width of the display window.

yres

The pixel height of the display window.

filter_style

The type of pixel filter. The default type is gauss.

filter_width

The amount of filtering for the filter_style input.

focal

The focal length of the camera.

focus

The focus distance of the camera.

fstop

The f-stop of the camera (the N in f/N).

aspect

The aspect ratio of display window (width divided by height).

aperture

The aperture width of the camera.

Time

Unit time (from 0.0 to 1.0) specifying what point in the shutter time the ray was sent.

Outputting a different value than what was passed in is how you achieve rolling shutter and other kinds of motion blur effect.

clippingrange

The values passed to your function represent the near and far clipping distances (taken from the camera to which the lens shader is assigned).

Your function can change these values, to change the near/far limits for the ray (the minimum and maximum distances the ray can travel).

With a perspective transform, you should adjust the clipping distances by the Z of the ray direction to ensure consistent distances. For other projections, the interpretation of the clipping range may be different.

isRHS

Whether you should interpret the values passed to your function given in RHS (right-hand space). If your shader does not take this argument, Houdini always passes values in left-hand space.

This argument is for better compatibility with Karma, which works in RHS, and better portability.

lambda

Selected wavelength from chromatic aberration. For internal use only.

Bokeh and Distortion

bokeh_offset

The offset, or jitter, for the ray’s origin. When this is set to be samples from a 2D distribution, the bokeh will match the shape of the distribution.

curv_offset

An offset for the ray direction’s Z value. This can be used to manipulate the curvature of the lens as it changes the direction of the ray. A value of 1.0 results in the ray being shot horizontally from the camera, and a value of 0.0 results in no change. Negative values can be also be input and they will point rays closer to the center of the lens.

curv_normal

The normal of the curvature, this is an optional input when using the Curvature Offset parameter. Some curvature distortions may have an easily calculated normal which can be used to better estimate chromatic aberration through the distorted lens.

NOTE: This is only used when refracting rays in chromatic aberration, it can be ignored if chromatic aberration is not in use.

eta

The index of refraction, eta, for the lens and given ray. This is used for chromatic aberration by refracting the given ray by the Curvature Normal and the Index of Refraction.

Shutter

toffset

The time offset of the shutter time. This determines when in the shutter time the ray will be sent, see understanding time offset and scale above for more information.

tscale

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.

Outputs

jitter

Set this to any relative jitter (horizontal and vertical) you applied to the pixel. You must output this variable if generating your own x and y.

Time

Unit time (from 0.0 to 1.0) specifying what point in the shutter time the ray was sent.

Outputting a different value than what was passed in is how you achieve rolling shutter and other kinds of motion blur effect.

P

Set this to the origin of the sent ray in 3D.

I

Set this to the direction of the ray sent ray as a vector.

tint

Set this to the color/contribution of the sent ray.

valid

After the function is run, set this to 1 or 0 to indicate whether the ray was valid or not. Setting this to 0 is the same as setting the contribution to {0, 0, 0}.

lambda

Selected wavelength from chromatic aberration. For internal use only.

See also

VOP nodes