RodLightFilter

Overview


The RodLightFilter is a movable, shapeable direct light blocker. The basic shape is a rounded box whose size, orientation, position, and roundness can be adjusted. Surfaces and media within the shape have their direct light contributions scaled according to the color of the filter.

The RodLightFilter scales the intensity of direct light within its volume, making objects within the volume darker or brighter. It can be used to control how dark and bright regions are by encapsulating them with the filter and setting the color.

The shape is based off a rectangular box whose dimensions may be given explicitly. The box may then be enlarged using a given radius which lets the box be rounded. An additional edge thickness determines a falloff zone where the shadow transitions from the values inside the rounded box to the values outside.

The rod can be placed using a transformation which supports curved motion blur, scaling, rotation and translation.

A Note About Performance

Each RodLightFilter incurs a small performance cost as each filter is checked for every light sample. We hope to improve this soon. At the moment, static (non-moving) filters are faster than moving ones, since the culling is faster for static filters.


Attribute Reference

Properties attributes

color

Rgb
default: [ 0, 0, 0 ]

Filter color. Scales the light within the volume. For each color channel: 0 means full shadow, 1 means no shadow.

density

Float
default: 1.0

Fades the filter effect. 0 means no effect (like having no filter). 1 means full effect.

depth

Float
default: 1.0

Depth of the base box (before radius and edge).

edge

Float
default: 0.0

Size of transition zone from the rounded box to the outside.

height

Float
default: 1.0

Height of the base box (before radius and edge).

intensity

Float
default: 1.0

Scalar for multiplying the color. 0 means black, 1 means no change.

invert

Bool
default: False

Swap application of filter from inside the volume to outside.

node_xform

Mat4d blurrable
default: [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]

Transform of the filter.

radius

Float
default: 0.0

Radius by which to expand the base box into a rounded box.

ramp_in_distances

FloatVector
default: {}

Input distance for ramp control.

ramp_interpolation_types

IntVector
default: {}

Interpolation types for ramp control.

ramp_out_distances

FloatVector
default: {}

Remapped distances for ramp control.

width

Float
default: 1.0

Width of the base box (before radius and edge).

General attributes

on

Bool
default: True

Turns the light filter on/off.


Examples


No light filter With RodLightFilter
filter = RodLightFilter("/Scene/lighting/rod") {   
    ["node_xform"] = translate(-1.5, 0, -6),
    ["width"] = 1,
    ["height"] = 1,
    ["depth"] = 1,
    ["radius"] = 0.1,
    ["edge"] = 0.1,
    ["color"] = Rgb(0.05, 0.05, 0.05),
    ["invert"] = false,
}