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.

Shader.SetGlobalBuffer

static function SetGlobalBuffer(propertyName: string, buffer: ComputeBuffer): void;
static void SetGlobalBuffer(string propertyName, ComputeBuffer buffer);
static def SetGlobalBuffer(propertyName as string, buffer as ComputeBuffer) as void

Description

Sets a global compute buffer property for all shaders.

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

See Also: SetGlobalTexture, ComputeBuffer class, ShaderLab documentation.