Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetMatrix

Get a named matrix value from the shader.
Read time 1 minuteLast updated 4 days ago

Definition

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

GetMatrix(string)

Get a named matrix value from the shader.
public Matrix4x4 GetMatrix(string name)

Parameters

name

The name of the property.

Returns

Type

Description

Matrix4x4

Remarks

This is mostly used with custom shaders that need extra matrix parameters. Matrix parameters are not exposed in the material inspector, but can be set and queried with SetMatrix and GetMatrix from scripts.

GetMatrix(int)

Get a named matrix value from the shader.
public Matrix4x4 GetMatrix(int nameID)

Parameters

nameID

The name ID of the property retrieved by Shader.PropertyToID.

Returns

Type

Description

Matrix4x4

Remarks

This is mostly used with custom shaders that need extra matrix parameters. Matrix parameters are not exposed in the material inspector, but can be set and queried with SetMatrix and GetMatrix from scripts.