要执行的图形命令的列表。
命令缓冲区可保存渲染命令列表(“设置渲染目标、绘制网格等等”)。可将渲染命令设置为在摄像机渲染(请参阅 Camera.AddCommandBuffer)、光源渲染(请参阅 Light.AddCommandBuffer)期间的各个点执行,或者立即执行(请参阅 Graphics.ExecuteCommandBuffer)。
Typically they would be used to extend Unity's render pipelines in a custom way. 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.
命令缓冲区创建后,可根据需要多次执行。
另请参阅:Camera.AddCommandBuffer、Light.AddCommandBuffer、CameraEvent、LightEvent、Graphics.ExecuteCommandBuffer、command buffers overview。
name | 此命令缓冲区的名称。 |
sizeInBytes | 此命令缓冲区的大小,以字节为单位(只读)。 |
CommandBuffer | 创建新的空命令缓冲区。 |
BeginSample | 添加命令,以开始对配置文件进行采样。 |
Blit | Adds a command to use a shader to copy the pixel data from a texture into a render texture. |
BuildRayTracingAccelerationStructure | Adds a command to build the RayTracingAccelerationStructure to be used in a ray tracing dispatch. |
Clear | 清除缓冲区中的所有命令。 |
ClearRandomWriteTargets | 为 Shader Model 4.5 级别的像素着色器清除随机写入目标。 |
ClearRenderTarget | 添加“清除渲染目标”命令。 |
ConfigureFoveatedRendering | Adds a command to configure foveated rendering. |
ConvertTexture | Adds a command to copy the pixel data from one texture, convert the data into a different format, and copy it into another texture. |
CopyBuffer | Adds a command to copy the contents of one GraphicsBuffer into another. |
CopyCounterValue | Adds a command to copy ComputeBuffer or GraphicsBuffer counter value. |
CopyTexture | Adds a command to copy pixel data from one texture to another. |
CreateAsyncGraphicsFence | Shortcut for calling CommandBuffer.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronisation as the first parameter. |
CreateGraphicsFence | Creates a GraphicsFence. |
DisableKeyword | Adds a command to disable a global or local shader keyword. |
DisableScissorRect | 添加用于禁用硬件剪辑矩形的命令。 |
DisableShaderKeyword | Adds a command to disable a global shader keyword with a given name. |
DispatchCompute | 添加用于执行 ComputeShader 的命令。 |
DispatchRays | Adds a command to execute a RayTracingShader. |
DrawMesh | 添加“绘制网格”命令。 |
DrawMeshInstanced | Adds a "draw mesh with instancing" command.The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive realtime shadows.如果 Material.enableInstancing 为 false,该命令不会立即失败并抛出异常,但如果检测到此类情况,则会记录错误并在每次执行命令时跳过渲染。如果当前平台不支持此 API(即,如果 GPU 实例化不可用),则会抛出 InvalidOperationException。请参阅 SystemInfo.supportsInstancing。 |
DrawMeshInstancedIndirect | 添加“通过间接实例化绘制网格”命令。 |
DrawMeshInstancedProcedural | 添加“通过实例化绘制网格”命令。Draw a mesh using Procedural Instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer. If Material.enableInstancing is false, the command logs an error and skips rendering each time the command is executed; the command does not immediately fail and throw an exception.InvalidOperationException will be thrown if the current platform doesn't support this API (for example, if GPU instancing is not available). See SystemInfo.supportsInstancing. |
DrawOcclusionMesh | 向 commandbuffer 添加命令以向当前渲染目标绘制 VR 设备的遮挡网格。 |
DrawProcedural | 添加“绘制程序化几何体”命令。 |
DrawProceduralIndirect | 添加“绘制程序化几何体”命令。 |
DrawRenderer | 添加“绘制渲染器”命令。 |
DrawRendererList | Adds a "draw renderer list" command. |
EnableKeyword | Adds a command to enable a global or local shader keyword. |
EnableScissorRect | 添加用于启用硬件剪辑矩形的命令。 |
EnableShaderKeyword | Adds a command to enable a global keyword with a given name. |
EndSample | Adds a command to end profile sampling. |
GenerateMips | 生成渲染纹理的多级渐进纹理级别。 |
GetTemporaryRT | 添加“获取临时渲染纹理”命令。 |
GetTemporaryRTArray | 添加“获取临时渲染纹理阵列”命令。 |
IncrementUpdateCount | 递增纹理的 updateCount 属性。 |
IssuePluginCustomBlit | 向本机代码插件发送用户定义的 blit 事件。 |
IssuePluginCustomTextureUpdateV2 | 向本机代码插件发送纹理更新事件。 |
IssuePluginEvent | 向本机代码插件发送用户定义的事件。 |
IssuePluginEventAndData | 向本机代码插件发送具有自定义数据的用户定义的事件。 |
IssuePluginEventAndDataWithFlags | Send a user-defined event to a native code plugin with custom data and callback flags. |
MarkLateLatchMatrixShaderPropertyID | Mark a global shader property id to be late latched. Possible shader properties include view, inverseView, viewProjection, and inverseViewProjection matrices. The Universal Render Pipeline (URP) uses this function to support late latching of shader properties. If you call this function when using built-in Unity rendering or the High-Definition Rendering Pipeline (HDRP), the results are ignored. |
ReleaseTemporaryRT | 添加“释放临时渲染纹理”命令。 |
RequestAsyncReadback | 向命令缓冲区添加异步 GPU 回读请求命令。 |
RequestAsyncReadbackIntoNativeArray | 向命令缓冲区添加异步 GPU 回读请求命令。 |
RequestAsyncReadbackIntoNativeSlice | 向命令缓冲区添加异步 GPU 回读请求命令。 |
ResolveAntiAliasedSurface | 强制解析抗锯齿渲染纹理。 |
SetBufferCounterValue | Adds a command to set the counter value of append/consume buffer. |
SetBufferData | Adds a command to set the buffer with values from an array. |
SetComputeBufferParam | 添加用于在 ComputeShader 中设置输入或输出缓冲区参数的命令。 |
SetComputeConstantBufferParam | Adds a command to set a constant buffer on a ComputeShader. |
SetComputeFloatParam | 添加用于在 ComputeShader 中设置浮点参数的命令。 |
SetComputeFloatParams | 添加用于在 ComputeShader 中设置多个连续浮点参数的命令。 |
SetComputeIntParam | 添加用于在 ComputeShader 中设置整数参数的命令。 |
SetComputeIntParams | 添加用于在 ComputeShader 中设置多个连续整数参数的命令。 |
SetComputeMatrixArrayParam | 添加用于在 ComputeShader 中设置矩阵数组参数的命令。 |
SetComputeMatrixParam | 添加用于在 ComputeShader 中设置矩阵参数的命令。 |
SetComputeParamsFromMaterial | Sets the parameters for a compute shader kernel from a Material. |
SetComputeTextureParam | 添加用于在 ComputeShader 中设置纹理参数的命令。 |
SetComputeVectorArrayParam | 添加用于在 ComputeShader 中设置向量数组参数的命令。 |
SetComputeVectorParam | 添加用于在 ComputeShader 中设置向量参数的命令。 |
SetExecutionFlags | 设置标志,描述有关如何执行命令缓冲区的意图。 |
SetFoveatedRenderingMode | Adds a command to set the mode to use for foveated rendering. |
SetGlobalBuffer | 添加“设置全局着色器缓冲区属性”命令。 |
SetGlobalColor | 添加“设置全局着色器颜色属性”命令。 |
SetGlobalConstantBuffer | 添加用于绑定全局常量缓冲区的命令。 |
SetGlobalDepthBias | Adds a command to set the global depth bias. |
SetGlobalFloat | 添加“设置全局着色器浮点属性”命令。 |
SetGlobalFloatArray | 添加“设置全局着色器浮点数组属性”命令。 |
SetGlobalInt | Adds a command to set the value of a given property for all Shaders, where the property has a type of Int in ShaderLab code. |
SetGlobalInteger | Adds a command to set the value of a given property for all Shaders, where the property is an integer. |
SetGlobalMatrix | 添加“设置全局着色器矩阵属性”命令。 |
SetGlobalMatrixArray | 添加“设置全局着色器矩阵数组属性”命令。 |
SetGlobalTexture | 添加“设置全局着色器纹理属性”命令(引用 RenderTexture)。 |
SetGlobalVector | 添加“设置全局着色器向量属性”命令。 |
SetGlobalVectorArray | 添加“设置全局着色器向量数组属性”命令。 |
SetInstanceMultiplier | 添加用于将每个绘制调用的实例数乘以特定乘数的命令。 |
SetInvertCulling | 向缓冲区添加“设置反转剔除”命令。 |
SetKeyword | Adds a command to set the state of a global or local shader keyword. |
SetLateLatchProjectionMatrices | Set the current stereo projection matrices for late latching. Stereo matrices is passed in as an array of two matrices. |
SetProjectionMatrix | 添加用于设置投影矩阵的命令。 |
SetRandomWriteTarget | 为 Shader Model 4.5 级别的像素着色器设置随机写入目标。 |
SetRayTracingAccelerationStructure | 添加命令以设置要与 RayTracingShader 一起使用的 RayTracingAccelerationStructure。 |
SetRayTracingBufferParam | Adds a command to set an input or output buffer parameter on a RayTracingShader. |
SetRayTracingConstantBufferParam | Adds a command to set a constant buffer on a RayTracingShader. |
SetRayTracingFloatParam | 添加用于在 RayTracingShader 中设置浮点参数的命令。 |
SetRayTracingFloatParams | 添加用于在 RayTracingShader 中设置多个连续浮点参数的命令。 |
SetRayTracingIntParam | 添加用于在 RayTracingShader 中设置整数参数的命令。 |
SetRayTracingIntParams | 添加用于在 RayTracingShader 中设置多个连续整数参数的命令。 |
SetRayTracingMatrixArrayParam | 添加用于在 RayTracingShader 中设置矩阵数组参数的命令。 |
SetRayTracingMatrixParam | 添加用于在 RayTracingShader 中设置矩阵参数的命令。 |
SetRayTracingShaderPass | Adds a command to select which Shader Pass to use when executing ray/geometry intersection shaders. |
SetRayTracingTextureParam | 添加用于在 RayTracingShader 中设置纹理参数的命令。 |
SetRayTracingVectorArrayParam | 添加用于在 RayTracingShader 中设置矢量数组参数的命令。 |
SetRayTracingVectorParam | 添加用于在 RayTracingShader 中设置矢量参数的命令。 |
SetRenderTarget | 添加“设置活动的渲染目标”命令。 |
SetShadowSamplingMode | 添加“设置阴影采样模式”命令。 |
SetSinglePassStereo | 添加用于为摄像机设置单通道立体模式的命令。 |
SetViewMatrix | 添加用于设置视图矩阵的命令。 |
SetViewport | 添加用于设置渲染视口的命令。 |
SetViewProjectionMatrices | 添加用于设置视图和投影矩阵的命令。 |
UnmarkLateLatchMatrix | Unmark a global shader property for late latching. After unmarking, the shader property will no longer be late latched. This function is intended for the Universal Render Pipeline (URP) to specify late latched shader properties. |
WaitAllAsyncReadbackRequests | 向 CommandBuffer 添加“AsyncGPUReadback.WaitAllRequests”命令。 |
WaitOnAsyncGraphicsFence | Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence. |