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), light rendering (see Light.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, or do custom processing of light
shadow maps. See command buffers overview page for more details.
Command buffers can be created and then executed many times if needed.
See Also: Camera.AddCommandBuffer, Light.AddCommandBuffer, CameraEvent, LightEvent, Graphics.ExecuteCommandBuffer, command buffers overview.
name | Name of this command buffer. |
sizeInBytes | Size of this command buffer in bytes (Read Only). |
CommandBuffer | Create a new empty command buffer. |
BeginSample | Adds a command to begin profile sampling. |
Blit | Add a "blit into a render texture" command. |
Clear | Clear all commands in the buffer. |
ClearRandomWriteTargets | Clear random write targets for Shader Model 4.5 level pixel shaders. |
ClearRenderTarget | Adds a "clear render target" command. |
ConvertTexture | Converts and copies a source texture to a destination texture with a different format or dimensions. |
CopyCounterValue | Adds a command to copy ComputeBuffer counter value. |
CopyTexture | Adds a command to copy a texture into another texture. |
CreateGPUFence | Creates a GPUFence which will be passed after the last Blit, Clear, Draw, Dispatch or Texture Copy command prior to this call has been completed on the GPU. |
DisableScissorRect | Add a command to disable the hardware scissor rectangle. |
DisableShaderKeyword | Adds a command to disable global shader keyword. |
DispatchCompute | Add a command to execute a ComputeShader. |
DrawMesh | Add a "draw mesh" command. |
DrawMeshInstanced | Add a "draw mesh with instancing" command.The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected.InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing. |
DrawMeshInstancedIndirect | Add a "draw mesh with indirect instancing" command. |
DrawProcedural | Add a "draw procedural geometry" command. |
DrawProceduralIndirect | Add a "draw procedural geometry" command. |
DrawRenderer | Add a "draw renderer" command. |
EnableScissorRect | Add a command to enable the hardware scissor rectangle. |
EnableShaderKeyword | Adds a command to enable global shader keyword. |
EndSample | Adds a command to begin profile sampling. |
GenerateMips | Generate mipmap levels of a render texture. |
GetTemporaryRT | Add a "get a temporary render texture" command. |
GetTemporaryRTArray | Add a "get a temporary render texture array" command. |
IssuePluginCustomBlit | Send a user-defined blit event to a native code plugin. |
IssuePluginCustomTextureUpdateV2 | Send a texture update event to a native code plugin. |
IssuePluginEvent | Send a user-defined event to a native code plugin. |
IssuePluginEventAndData | Send a user-defined event to a native code plugin with custom data. |
ReleaseTemporaryRT | Add a "release a temporary render texture" command. |
RequestAsyncReadback | Adds an asynchonous GPU readback request command to the command buffer. |
ResolveAntiAliasedSurface | Force an antialiased render texture to be resolved. |
SetComputeBufferParam | Adds a command to set an input or output buffer parameter on a ComputeShader. |
SetComputeFloatParam | Adds a command to set a float parameter on a ComputeShader. |
SetComputeFloatParams | Adds a command to set multiple consecutive float parameters on a ComputeShader. |
SetComputeIntParam | Adds a command to set an integer parameter on a ComputeShader. |
SetComputeIntParams | Adds a command to set multiple consecutive integer parameters on a ComputeShader. |
SetComputeMatrixArrayParam | Adds a command to set a matrix array parameter on a ComputeShader. |
SetComputeMatrixParam | Adds a command to set a matrix parameter on a ComputeShader. |
SetComputeTextureParam | Adds a command to set a texture parameter on a ComputeShader. |
SetComputeVectorArrayParam | Adds a command to set a vector array parameter on a ComputeShader. |
SetComputeVectorParam | Adds a command to set a vector parameter on a ComputeShader. |
SetGlobalBuffer | Add a "set global shader buffer property" command. |
SetGlobalColor | Add a "set global shader color property" command. |
SetGlobalDepthBias | Add a command to set global depth bias. |
SetGlobalFloat | Add a "set global shader float property" command. |
SetGlobalFloatArray | Add a "set global shader float array property" command. |
SetGlobalInt | Sets the given global integer property for all shaders. |
SetGlobalMatrix | Add a "set global shader matrix property" command. |
SetGlobalMatrixArray | Add a "set global shader matrix array property" command. |
SetGlobalTexture | Add a "set global shader texture property" command, referencing a RenderTexture. |
SetGlobalVector | Add a "set global shader vector property" command. |
SetGlobalVectorArray | Add a "set global shader vector array property" command. |
SetInvertCulling | Add a "set invert culling" command to the buffer. |
SetProjectionMatrix | Add a command to set the projection matrix. |
SetRandomWriteTarget | Set random write target for Shader Model 4.5 level pixel shaders. |
SetRenderTarget | Add a "set active render target" command. |
SetShadowSamplingMode | Add a "set shadow sampling mode" command. |
SetViewMatrix | Add a command to set the view matrix. |
SetViewport | Add a command to set the rendering viewport. |
SetViewProjectionMatrices | Add a command to set the view and projection matrices. |
WaitOnGPUFence | Instructs the GPU to wait until the given GPUFence is passed. |