Version: 1.11
LanguageEnglish
  • C#

ScriptableRenderContext.CreatePreparedRendererProxy

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 Rendering.PreparedRendererProxy CreatePreparedRendererProxy(Renderer renderer, Material material, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix);

Parameters

renderer The Renderer whose render data to capture.
material The Material to use when drawing the prepared renderer.
viewMatrix The view matrix to use for matrix-dependent renderer preparation.
projectionMatrix The projection matrix to use for matrix-dependent renderer preparation.

Returns

PreparedRendererProxy A proxy for the prepared renderer data.

Description

Captures renderer and material data and returns a proxy that a CommandBuffer can draw without accessing the Renderer.

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

Call this method on the main thread. It immediately captures the renderer, material, transform, and matrix-dependent preparation results. Changes to those values after this call are not reflected in the proxy.

This method does not perform Camera culling. Create a separate proxy for every distinct view and projection matrix pair. The returned proxy is owned by this ScriptableRenderContext and cannot be cached across contexts or frames. You can reuse it with different submesh indices and shader passes while its creating context remains valid.

See Also: PreparedRendererProxy, CommandBuffer.DrawPreparedRenderer.