motionVectorMode
Motion vector mode.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Field
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public MotionVectorGenerationMode motionVectorMode
Remarks
Unity configures the following built-in shader uniforms to calculate motion vectors in HLSL code: , and .
unity_MotionVectorsParamsunity_MatrixPreviousMunity_MatrixPreviousMIFor Mesh ray tracing instances, is a vector uniform. Its component values are as follows:
unity_MotionVectorsParams- the x and z components are 0
- the y component is 0 if the motion vector mode is MotionVectorGenerationMode.ForceNoMotion. Otherwise it is 1.
- the w component is 0 if the motion vector mode is MotionVectorGenerationMode.Camera. Otherwise it is 1.
unity_MatrixPreviousMunity_MatrixPreviousMITo access the ray tracing instance matrix in closest hit, any hit, and intersection shaders, use the or HLSL functions.
ObjectToWorldWorldToObjectAdditional Resources: MotionVectorGenerationMode.