Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetMatrix

Sets the value of a matrix uniform.
Read time 1 minuteLast updated 9 days ago

Definition

SetMatrix(int, Matrix4x4)

Sets the value of a matrix uniform.
public void SetMatrix(int nameID, Matrix4x4 val)

Parameters

nameID

The ID of the property as given by Shader.PropertyToID.

The matrix to set.

Remarks

Only shaders defined in the .raytrace file can access the matrix you designate as the argument for this method. To make this matrix accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalMatrix method instead.

SetMatrix(string, Matrix4x4)

Sets the value of a matrix uniform.
public void SetMatrix(string name, Matrix4x4 val)

Parameters

name

The name of the property being set.

The matrix to set.

Remarks

Only shaders defined in the .raytrace file can access the matrix you designate as the argument for this method. To make this matrix accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalMatrix method instead.