Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetGlobalBuffer

Sets a global buffer property for all shaders.
Read time 2 minutesLast updated 4 days ago

Definition

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

SetGlobalBuffer(string, ComputeBuffer)

Sets a global buffer property for all shaders.
public static void SetGlobalBuffer(string name, ComputeBuffer value)

Parameters

name

The name of the property.

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).

SetGlobalBuffer(int, ComputeBuffer)

Sets a global buffer property for all shaders.
public static void SetGlobalBuffer(int nameID, ComputeBuffer value)

Parameters

nameID

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

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).

SetGlobalBuffer(string, GraphicsBuffer)

Sets a global buffer property for all shaders.
public static void SetGlobalBuffer(string name, GraphicsBuffer value)

Parameters

name

The name of the property.

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).

SetGlobalBuffer(int, GraphicsBuffer)

Sets a global buffer property for all shaders.
public static void SetGlobalBuffer(int nameID, GraphicsBuffer value)

Parameters

nameID

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

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).