Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.


Namespace: UnityEngine.Rendering

Suggest a change


Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.


Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.



Switch to Manual


List of graphics commands to execute.

Command buffers hold list of rendering commands ("set render target, draw mesh, ..."). They can be set to execute at various points during camera rendering (see Camera.AddCommandBuffer), or be executed immediately (see Graphics.ExecuteCommandBuffer).

Typically they would be used to extend Unity's rendering pipeline in some custom ways. For example, you could render some additional objects into deferred rendering g-buffer after all regular objects are done.

Command buffers can be created and then executed many times if needed.

See Also: Camera.AddCommandBuffer, CameraEvent, Graphics.ExecuteCommandBuffer.


nameName of this command buffer.
sizeInBytesSize of this command buffer in bytes (Read Only).


CommandBufferCreate a new empty command buffer.

Public Functions

BlitAdd a "blit into a render texture" command.
ClearClear all commands in the buffer.
ClearRenderTargetAdds a "clear render target" command.
DrawMeshAdd a "draw mesh" command.
DrawRendererAdd a "draw renderer" command.
GetTemporaryRTAdd a "get a temporary render texture" command.
ReleaseTemporaryRTAdd a "release a temporary render texture" command.
SetGlobalColorAdd a "set global shader color property" command.
SetGlobalFloatAdd a "set global shader float property" command.
SetGlobalMatrixAdd a "set global shader matrix property" command.
SetGlobalTextureAdd a "set global shader texture property" command.
SetGlobalVectorAdd a "set global shader vector property" command.
SetRenderTargetAdd a "set active render target" command.