Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetMatrix

Set a Matrix parameter.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

SetMatrix(int, Matrix4x4)

Set a Matrix parameter.
public void SetMatrix(int nameID, Matrix4x4 val)

Parameters

nameID

Property name ID, use Shader.PropertyToID to get it.

Value to set.

Remarks

Constant buffers are shared between all kernels in a single compute shader asset. Therefore this function affects all kernels in this ComputeShader.

SetMatrix(string, Matrix4x4)

Set a Matrix parameter.
public void SetMatrix(string name, Matrix4x4 val)

Parameters

name

Variable name in shader code.

Value to set.

Remarks

Constant buffers are shared between all kernels in a single compute shader asset. Therefore this function affects all kernels in this ComputeShader.