# SetGlobalMatrix

> Sets a global matrix property for all shaders.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## SetGlobalMatrix(string, Matrix4x4)

Sets a global matrix property for all shaders.

```csharp
public static void SetGlobalMatrix(string name, Matrix4x4 value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.**** (\[Matrix4x4]\(/engine/6000.6/script-reference/unityengine/matrix4x4)):&#x20;

### Remarks

Global properties are used if a shader needs them but the material does not have them defined (for example, if the shader does not expose them in `Properties` block).

Additional Resources: [Shader.SetGlobalColor](/engine/6000.6/script-reference/unityengine/shader/setglobalcolor.md), [Shader.SetGlobalFloat](/engine/6000.6/script-reference/unityengine/shader/setglobalfloat.md); [Material](/engine/6000.6/script-reference/unityengine/material.md) class, [ShaderLab documentation](/engine/6000.6/script-reference/unityengine/shaders.md).

## SetGlobalMatrix(int, Matrix4x4)

Sets a global matrix property for all shaders.

```csharp
public static void SetGlobalMatrix(int nameID, Matrix4x4 value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.6/script-reference/unityengine/shader/propertytoid.md).**** (\[Matrix4x4]\(/engine/6000.6/script-reference/unityengine/matrix4x4)):&#x20;

### Remarks

Global properties are used if a shader needs them but the material does not have them defined (for example, if the shader does not expose them in `Properties` block).

Additional Resources: [Shader.SetGlobalColor](/engine/6000.6/script-reference/unityengine/shader/setglobalcolor.md), [Shader.SetGlobalFloat](/engine/6000.6/script-reference/unityengine/shader/setglobalfloat.md); [Material](/engine/6000.6/script-reference/unityengine/material.md) class, [ShaderLab documentation](/engine/6000.6/script-reference/unityengine/shaders.md).
