# SetGlobalBuffer

> Sets a global buffer property for all shaders.

## Definition

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

## SetGlobalBuffer(string, ComputeBuffer)

Sets a global buffer property for all shaders.

```csharp
public static void SetGlobalBuffer(string name, ComputeBuffer value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.**** (\[ComputeBuffer]\(/engine/6000.0/script-reference/unityengine/computebuffer)): The buffer to set.

### 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.SetGlobalTexture](/engine/6000.0/script-reference/unityengine/shader/setglobaltexture.md), [ComputeBuffer](/engine/6000.0/script-reference/unityengine/computebuffer.md) class, [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) class, [ShaderLab documentation](/engine/6000.0/manual/materials-and-shaders/shaders.md).

## SetGlobalBuffer(int, ComputeBuffer)

Sets a global buffer property for all shaders.

```csharp
public static void SetGlobalBuffer(int nameID, ComputeBuffer value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.0/script-reference/unityengine/shader/propertytoid.md).**** (\[ComputeBuffer]\(/engine/6000.0/script-reference/unityengine/computebuffer)): The buffer to set.

### 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.SetGlobalTexture](/engine/6000.0/script-reference/unityengine/shader/setglobaltexture.md), [ComputeBuffer](/engine/6000.0/script-reference/unityengine/computebuffer.md) class, [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) class, [ShaderLab documentation](/engine/6000.0/manual/materials-and-shaders/shaders.md).

## SetGlobalBuffer(string, GraphicsBuffer)

Sets a global buffer property for all shaders.

```csharp
public static void SetGlobalBuffer(string name, GraphicsBuffer value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.**** (\[GraphicsBuffer]\(/engine/6000.0/script-reference/unityengine/graphicsbuffer)): The buffer to set.

### 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.SetGlobalTexture](/engine/6000.0/script-reference/unityengine/shader/setglobaltexture.md), [ComputeBuffer](/engine/6000.0/script-reference/unityengine/computebuffer.md) class, [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) class, [ShaderLab documentation](/engine/6000.0/manual/materials-and-shaders/shaders.md).

## SetGlobalBuffer(int, GraphicsBuffer)

Sets a global buffer property for all shaders.

```csharp
public static void SetGlobalBuffer(int nameID, GraphicsBuffer value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.0/script-reference/unityengine/shader/propertytoid.md).**** (\[GraphicsBuffer]\(/engine/6000.0/script-reference/unityengine/graphicsbuffer)): The buffer to set.

### 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.SetGlobalTexture](/engine/6000.0/script-reference/unityengine/shader/setglobaltexture.md), [ComputeBuffer](/engine/6000.0/script-reference/unityengine/computebuffer.md) class, [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) class, [ShaderLab documentation](/engine/6000.0/manual/materials-and-shaders/shaders.md).
