Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Light filters change the color of a light after the light has been sampled.

Binding and linking

Light filters are bound to lights like bxdfs are bound to geometry: they obey attribute scoping and the last one specified wins.

Code Block
LightFilter "PxrGobo" "gobo1"

...

  "string coordSys" ["Gobo1"] "string map" ["ratGrid.tx"]

...


Light "PxrPrectLight" "light1"


Like lights, light filters are enabled by default.  Light filters may be selectively enabled using a group membership similar to light linking and ray tracing subsets.  By default, a light filter belongs to a global group and is enabled everywhere.  If a filter expresses that it belongs to a named group, it will instead be disabled by default and enabled for only those geometric primitives that subscribe to the group.  Light filter groups are specified through a parameter to the light filter and reported to the renderer through the light filter GetProperty() method (see below).  For example:

...

Will turn on all light filters in group "blockers" for all lights shining on the sphere.  By convention, all of the filters shipped with RenderMan use "linkingGroups" as the name of the parameter.   Both the "linkingGroups" and "lightfilter:subset" strings may be comma-separated lists of group names.  Group name matching is not scoped to a light.  Any filter in a matching group on any light active on a given geometric primitive will be enabled.

...

Filter()

A light filter plugin implements the following method:

Code Block
languagecpp
virtual void Filter(RixLightFilterContext const *lfCtx,
                    RtConstPointer instanceData,
                    RtInt const numSamples,
                    RtInt const * shadingCtxIndex,
                    RtVector3 const * toLight,
                    RtFloat const * dist,
                    RtFloat const * lightPdfIllum,
                    RixBXLobeWeights *contribution
                    );

...


	RixLightFilterContext const *lfCtx,

...

    

...

RtConstPointer instanceData,
    

...

RtInt const numSamples,

...

    

...

RtInt const * shadingCtxIndex,

...

    

...

RtVector3 const * toLight,
    

...

RtFloat const * dist,

...

    RtFloat const * lightPdfIllum,

...

    

...

RixBXLobeWeights *contribution

...

);

...


Like pattern plugins, light filters are supplied a context. The RixLightFilterContext is a subset of the  RixShadingContext  and does not support full pattern generation ( EvalParam()  is not supported). That capability is under consideration for future releases.

...