기술 자료

Unity Engine

Unity Engine

GetMatrix

Get a named matrix value from the shader.
읽는 시간 1분최근 업데이트: 한 달 전

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.