Version: 2020.1

CommandBuffer

class in UnityEngine.Rendering

マニュアルに切り替える

説明

実行するグラフィックスコマンドのリスト

コマンドバッファはレンダリングコマンド ("set render target, draw mesh, ...") のリストを保持し、Camera Rendering (Camera.AddCommandBufferを参照) や Light Rendering (Light.AddCommandBuffer を参照) を実行中にさまざまなポイントで実行するように設定でき、すぐに実行されます (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 Buffer は、何度でも実行することができます。

See Also: Camera.AddCommandBuffer, Light.AddCommandBuffer, CameraEvent, LightEvent, Graphics.ExecuteCommandBuffer, command buffers overview.

変数

nameこのコマンドバッファーの名前
sizeInBytesこのコマンドバッファーのバイトでのサイズ(読み出し専用)

コンストラクタ

CommandBuffer新しい空の Command Buffer を作成します。

Public 関数

BeginSampleAdds a command to begin profile sampling.
Blit"blit into a render texture" コマンドを追加します。
BuildRayTracingAccelerationStructureAdds a command to build the RayTracingAccelerationStructure to be used for the scene.
Clearバッファのすべてのコマンドをクリアします。
ClearRandomWriteTargetsClear random write targets for Shader Model 4.5 level pixel shaders.
ClearRenderTarget"clear render target" コマンドを追加します。
ConvertTextureConverts and copies a source texture to a destination texture with a different format or dimensions.
CopyCounterValueAdds a command to copy ComputeBuffer or GraphicsBuffer counter value.
CopyTextureAdds a command to copy a texture into another texture.
CreateAsyncGraphicsFenceShortcut for calling GommandBuffer.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronization as the first parameter.
CreateGraphicsFenceCreates a GraphicsFence 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.
DisableScissorRectAdd a command to disable the hardware scissor rectangle.
DisableShaderKeywordAdds a command to disable global shader keyword.
DispatchComputeAdd a command to execute a ComputeShader.
DispatchRaysAdd a command to execute a RayTracingShader.
DrawMesh"Draw Mesh" コマンドをを追加します。
DrawMeshInstancedAdd 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.
DrawMeshInstancedIndirectAdd a "draw mesh with indirect instancing" command.
DrawMeshInstancedProceduralAdd a "draw mesh with instancing" command.Draw a mesh using Procedural Instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer. 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.
DrawOcclusionMeshAdds a command onto the commandbuffer to draw the VR Device's occlusion mesh to the current render target.
DrawProcedural"draw procedural geometry" コマンドを追加。
DrawProceduralIndirect"draw procedural geometry" コマンドを追加。
DrawRendererDraw Renderer コマンドを追加します。
EnableScissorRectAdd a command to enable the hardware scissor rectangle.
EnableShaderKeywordAdds a command to enable global shader keyword.
EndSampleAdds a command to begin profile sampling.
GenerateMipsGenerate mipmap levels of a render texture.
GetTemporaryRT"get a temporary render texture" コマンドを追加します。
GetTemporaryRTArrayAdd a "get a temporary render texture array" command.
IncrementUpdateCountIncrements the updateCount property of a Texture.
IssuePluginCustomBlitSend a user-defined blit event to a native code plugin.
IssuePluginCustomTextureUpdateV2Send a texture update event to a native code plugin.
IssuePluginEventネイティブコードプラグインにユーザーが定義したイベントを送信します
IssuePluginEventAndDataSend a user-defined event to a native code plugin with custom data.
ReleaseTemporaryRT"release a temporary render texture" コマンドを追加します。
RequestAsyncReadbackAdds an asynchonous GPU readback request command to the command buffer.
RequestAsyncReadbackIntoNativeArrayAdds an asynchonous GPU readback request command to the command buffer.
ResolveAntiAliasedSurfaceForce an antialiased render texture to be resolved.
SetComputeBufferCounterValueAdds a command to set the counter value of append/consume buffer.
SetComputeBufferDataAdds a command to set the buffer with values from an array.
SetComputeBufferParamAdds a command to set an input or output buffer parameter on a ComputeShader.
SetComputeConstantBufferParamAdds a command to set a constant buffer on a ComputeShader.
SetComputeFloatParamAdds a command to set a float parameter on a ComputeShader.
SetComputeFloatParamsAdds a command to set multiple consecutive float parameters on a ComputeShader.
SetComputeIntParamAdds a command to set an integer parameter on a ComputeShader.
SetComputeIntParamsAdds a command to set multiple consecutive integer parameters on a ComputeShader.
SetComputeMatrixArrayParamAdds a command to set a matrix array parameter on a ComputeShader.
SetComputeMatrixParamAdds a command to set a matrix parameter on a ComputeShader.
SetComputeTextureParamAdds a command to set a texture parameter on a ComputeShader.
SetComputeVectorArrayParamAdds a command to set a vector array parameter on a ComputeShader.
SetComputeVectorParamAdds a command to set a vector parameter on a ComputeShader.
SetExecutionFlagsSet flags describing the intention for how the command buffer will be executed.
SetGlobalBufferAdd a "set global shader buffer property" command.
SetGlobalColor"set global shader color property" コマンドを追加します。
SetGlobalConstantBufferAdd a command to bind a global constant buffer.
SetGlobalDepthBiasAdd a command to set global depth bias.
SetGlobalFloat"set global shader float property" コマンドを追加します。
SetGlobalFloatArray"set global shader float array property" コマンドを追加します。
SetGlobalIntSets the given global integer property for all shaders.
SetGlobalMatrix"set global shader matrix property" コマンドを追加します。
SetGlobalMatrixArray"set global shader matrix array property" コマンドを追加します。
SetGlobalTextureRenderTexture を参照する "set global shader texture property" コマンドを追加します。
SetGlobalVector"set global shader vector property" コマンドを追加します。
SetGlobalVectorArray"set global shader vector array property" コマンドを追加します。
SetInstanceMultiplierAdds a command to multiply the instance count of every draw call by a specific multiplier.
SetInvertCullingAdd a "set invert culling" command to the buffer.
SetProjectionMatrixAdd a command to set the projection matrix.
SetRandomWriteTargetSet random write target for Shader Model 4.5 level pixel shaders.
SetRayTracingAccelerationStructureAdds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader.
SetRayTracingBufferParamAdds a command to set an input or output buffer parameter on a RayTracingShader.
SetRayTracingConstantBufferParamAdds a command to set a constant buffer on a RayTracingShader.
SetRayTracingFloatParamAdds a command to set a float parameter on a RayTracingShader.
SetRayTracingFloatParamsAdds a command to set multiple consecutive float parameters on a RayTracingShader.
SetRayTracingIntParamAdds a command to set an integer parameter on a RayTracingShader.
SetRayTracingIntParamsAdds a command to set multiple consecutive integer parameters on a RayTracingShader.
SetRayTracingMatrixArrayParamAdds a command to set a matrix array parameter on a RayTracingShader.
SetRayTracingMatrixParamAdds a command to set a matrix parameter on a RayTracingShader.
SetRayTracingShaderPassAdds a command to set the pass for the RayTracingShader to be used.
SetRayTracingTextureParamAdds a command to set a texture parameter on a RayTracingShader.
SetRayTracingVectorArrayParamAdds a command to set a vector array parameter on a RayTracingShader.
SetRayTracingVectorParamAdds a command to set a vector parameter on a RayTracingShader.
SetRenderTarget"set active render target" コマンドを追加します。
SetShadowSamplingMode"set global shader matrix property" コマンドを追加します。
SetSinglePassStereoAdd a command to set single-pass stereo mode for the camera.
SetViewMatrixAdd a command to set the view matrix.
SetViewportAdd a command to set the rendering viewport.
SetViewProjectionMatricesAdd a command to set the view and projection matrices.
WaitAllAsyncReadbackRequestsAdds an "AsyncGPUReadback.WaitAllRequests" command to the CommandBuffer.
WaitOnAsyncGraphicsFenceInstructs the GPU to wait until the given GraphicsFence is passed.