Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Material.GetMatrix

GetMatrix(propertyName: string): Matrix4x4;
Matrix4x4 GetMatrix(string propertyName);
def GetMatrix(propertyName as string) as Matrix4x4
GetMatrix(nameID: int): Matrix4x4;
Matrix4x4 GetMatrix(int nameID);
def GetMatrix(nameID as int) as Matrix4x4

Description

Get a named matrix value from the shader.

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.

See Also: SetMatrix, Materials, ShaderLab documentation, Shader.PropertyToID.