Version: 1.11
LanguageEnglish
  • C#

CommandBuffer.DrawPreparedRenderer

Suggest a change

Success!

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.

Close

Submission failed

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

Close

Cancel

Declaration

public void DrawPreparedRenderer(Rendering.PreparedRendererProxy proxy, int submeshIndex = 0, int shaderPass = -1);

Parameters

proxy The prepared renderer data to draw.
submeshIndex The index of the submesh to render. The default value is 0.
shaderPass The index of the shader pass to use. The default value is -1, which renders all passes.

Description

Adds a command to draw renderer data captured in a PreparedRendererProxy.

This method is only supported when parallel rendering is enabled. Otherwise, it throws an InvalidOperationException.

Create the proxy with ScriptableRenderContext.CreatePreparedRendererProxy. You can reuse a proxy to draw different submeshes and shader passes.

The command must execute through the ScriptableRenderContext that created the proxy, while that context is still valid. A CommandBuffer that contains this command can be recorded on the main-thread or rendering-thread SRP path, but must not be written from multiple threads concurrently.

See Also: PreparedRendererProxy, ScriptableRenderContext.CreatePreparedRendererProxy, DrawRenderer.