Documentation

Unity Engine

Download Unity

Unity Engine

FilterParameterWriter

Writes the parameters of a filter pass for one element, by shader property.
Read time 2 minutesLast updated 6 days ago

Definition

public ref struct FilterParameterWriter

Remarks

To draw the pass of many elements together, declare the properties with Unity's instancing macros (
UNITY_DEFINE_INSTANCED_PROP
) and enable GPU instancing on the material. UI Toolkit sets the properties whose names start with
_UIE_
. The writer is valid only during the PostProcessingPass.writeParametersCallback call.
The
Set
methods copy the value that you pass. To compute a value directly where the shader reads it, such as a matrix, use FilterParameterWriter.GetOrAddMatrixRef, FilterParameterWriter.GetOrAddVectorRef, FilterParameterWriter.GetOrAddColorRef, or FilterParameterWriter.GetOrAddFloatRef. To read a value that the pass already wrote, for example through a parameter binding, use the
TryGet
methods.

Methods

Method

Description

GetOrAddColorRefReturns a reference to the value of a color property, as (r, g, b, a), to write it in place, and adds the property if this pass hasn't written it. No color space conversion is applied.
GetOrAddFloatRefReturns a reference to the value of a float property, to write it in place, and adds the property if this pass hasn't written it.
GetOrAddMatrixRefReturns a reference to the value of a matrix property, to write it in place, and adds the property if this pass hasn't written it.
GetOrAddVectorRefReturns a reference to the value of a vector property, to write it in place, and adds the property if this pass hasn't written it.
SetColorWrites a color property, as (r, g, b, a). No color space conversion is applied.
SetFloatWrites a float property.
SetMatrixWrites a matrix property.
SetVectorWrites a vector property.
TryGetColorReads a color property that this pass has written, for example through a parameter binding.
TryGetFloatReads a float property that this pass has written, for example through a parameter binding.
TryGetMatrixReads a matrix property that this pass has written.
TryGetVectorReads a vector property that this pass has written, for example through a parameter binding.