ColorRampLightFilter

Overview


The Color Ramp light filter applies a radial or directional ramp function to the light’s output.


Attribute Reference

Properties attributes

begin_distance

Float
default: 0.0

Where the ramp starts relative to the light or the ramp's independent transform

colors

RgbVector
default: [[ 1, 1, 1 ], [ 0, 0, 0 ]]

Vector of colors specified at different distances

density

Float
default: 1.0

The density of the filter

distances

FloatVector
default: {}

Distances between which colors are interpolated

end_distance

Float
default: 1.0

Where the ramp ends relative to the light or the ramp's independent transform

intensity

Float
default: 1.0

The intensity of the filter

interpolation_types

IntVector
default: {}

Interpolation types between the specified distances. 0: None 1: linear 2: exponential_up 3: exponential_down 4: smooth 5: catmull_rom

mode

Int enum
  0 = “radial” (default)
  1 = “directional”

Ramp: Radiates out from the center of the light or ramp location. Directional: Linear starting at the location of the light or ramp location along negative z

node_xform

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

Orientation of the light filter

wrap_mode

Int enum
  0 = “extend” (default)
  1 = “mirror”

For directional filter mode where filter uses distance along -Z axis. Extend: f(z) = f(0) for z > 0. Mirror: f(z) = f(-z).

General attributes

on

Bool
default: True

Turns the light filter on/off.

use_xform

Bool
default: False

The filter can be bound to a light or lights position or when this toggle is set, can have its own transform


Examples


No ramp - defaults to black
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
}
Simple ramp between blue and red
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
    ["colors"] = { Rgb(0, 0, 1), Rgb(1, 0, 0)},
    ["distances"] = {4.0, 8.0},
}
Simple ramp between blue and red, no interpolation
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
    ["colors"] = { Rgb(0, 0, 1), Rgb(1, 0, 0)},
    ["distances"] = {4.0, 8.0},
    ["interpolation_types"] = {0, 0},
}
Ramp between 3 colors, no interpolation
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
    ["colors"] = { Rgb(0, 0, 1), Rgb(1, 0, 0), Rgb(0, 1, 0)},
    ["distances"] = {4.0, 6.0, 8.0},
    ["interpolation_types"] = {0, 0, 0},
}
Ramp between 3 colors, linear interpolation, intensity
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
    ["colors"] = { Rgb(0, 0, 1), Rgb(1, 0, 0), Rgb(0, 1, 0)},
    ["distances"] = {4.0, 6.0, 8.0},
    ["interpolation_types"] = {1, 1, 1},
    ["intensity"] = 2.0
}
Ramp between 3 colors, linear interpolation, density
filter = ColorRampLightFilter("/Scene/lighting/colorRamp") {
    ["colors"] = { Rgb(0, 0, 1), Rgb(1, 0, 0), Rgb(0, 1, 0)},
    ["distances"] = {4.0, 6.0, 8.0},
    ["interpolation_types"] = {1, 1, 1},
    ["density"] = 0.5
}