CombineLightFilter

Overview


The Combine light filter combines the effect of multiple light filters, with one of several modes:

  • Multiply
  • Add
  • Subtract
  • min()
  • max()

The light filters are specified as an ordered list with the “light_filters” attribute. ALL referenced light filters must exist in the LightFilterSet, not just the CombineLightFilter.


Attribute Reference

General attributes

light_filters

SceneObject Vector
default: {}

List of light filters to combine together

mode

Int enum
  0 = “multiply” (default)
  1 = “min”
  2 = “max”
  3 = “add”
  4 = “subtract”

How the light filters are combined

on

Bool
default: True

Turns the light filter on/off.


Examples


RodLightFilter("/RIG/RodLightFilter1") {
    ["color"] = Rgb(0, 0, 1),
    ["node_xform"] = Mat4(3.0, 0.0, 0.0, 0.0,
                          0.0, 3.0, 0.0, 0.0,
                          0.0, 0.0, 3.0, 0.0, 
                         -0.931609630585, 0.0, -0.5, 1.0),
}

RodLightFilter("/RIG/RodLightFilter2") {
    ["color"] = Rgb(1, 0, 0),
    ["node_xform"] = Mat4(3.0, 0.0, 0.0, 0.0,
                          0.0, 3.0, 0.0, 0.0,
                          0.0, 0.0, 3.0, 0.0, 
                          1.05325031281, 0.0, -0.5, 1.0),
}

CombineLightFilter("/RIG/CombineLightFilter1") {
    ["light_filters"] = {RodLightFilter("/RIG/RodLightFilter1"),
                         RodLightFilter("/RIG/RodLightFilter2")},

    ["mode"] = 0, -- multiply filter values
    --["mode"] = 1, -- min filter value
    --["mode"] = 2, -- max filter value
    --["mode"] = 3, -- add filter values, clamp to 1
    --["mode"] = 4, -- subtract (first filter - 2nd - 3rd...) clamped to zero
}

LightFilterSet("/Scene/lightfilterset/3") {
    RodLightFilter("/RIG/RodLightFilter1"), 
    RodLightFilter("/RIG/RodLightFilter2"), 
    CombineLightFilter("/RIG/CombineLightFilter1"),
}