FilterParameterWriter
Writes the parameters of a filter pass for one element, by shader property.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public ref struct FilterParameterWriter
Remarks
To draw the pass of many elements together, declare the properties with Unity's instancing macros () and enable GPU instancing on the material. UI Toolkit sets the properties whose names start with . The writer is valid only during the PostProcessingPass.writeParametersCallback call.
UNITY_DEFINE_INSTANCED_PROP_UIE_The 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 methods.
SetTryGetMethods
Method | Description |
|---|---|
| GetOrAddColorRef | Returns 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. |
| GetOrAddFloatRef | Returns 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. |
| GetOrAddMatrixRef | Returns 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. |
| GetOrAddVectorRef | Returns 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. |
| SetColor | Writes a color property, as (r, g, b, a). No color space conversion is applied. |
| SetFloat | Writes a float property. |
| SetMatrix | Writes a matrix property. |
| SetVector | Writes a vector property. |
| TryGetColor | Reads a color property that this pass has written, for example through a parameter binding. |
| TryGetFloat | Reads a float property that this pass has written, for example through a parameter binding. |
| TryGetMatrix | Reads a matrix property that this pass has written. |
| TryGetVector | Reads a vector property that this pass has written, for example through a parameter binding. |