Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

ScriptableRenderContext

struct in UnityEngine.Experimental.Rendering

/

Implemented in:UnityEngine.CoreModule

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

Description

Defines state and drawing commands used in a custom render pipelines.

When defining a custom RenderPipeline, a ScriptableRenderContext is used to set state and drawing commands to be submitted to the GPU.

A RenderPipeline.Render method implementation typically culls objects that don't need to be rendered for all the Cameras (see CullResults), and then makes a series of calls to ScriptableRenderContext.DrawRenderers intermixed with ScriptableRenderContext.ExecuteCommandBuffer calls. These calls set up global Shader properties, change render targets, dispatch compute shaders, and other rendering tasks. Finally, ScriptableRenderContext.Submit is called to execute the render loop.

See Also: RenderPipeline.

Public Methods

DrawRenderersDraw subset of visible objects.
DrawShadowsDraw shadow casters for a single light.
DrawSkyboxDraw skybox.
ExecuteCommandBufferExecute a custom graphics command buffer.
ExecuteCommandBufferAsyncExecutes a command buffer on an async compute queue with the queue selected based on the ComputeQueueType parameter passed.It is required that all of the commands within the command buffer be of a type suitable for execution on the async compute queues. If the buffer contains any commands that are not appropriate then an error will be logged and displayed in the editor window. Specifically the following commands are permitted in a CommandBuffer intended for async execution:CommandBuffer.BeginSampleCommandBuffer.CopyCounterValueCommandBuffer.CopyTextureCommandBuffer.CreateGPUFenceCommandBuffer.DispatchComputeCommandBuffer.EndSampleCommandBuffer.IssuePluginEventCommandBuffer.SetComputeBufferParamCommandBuffer.SetComputeFloatParamCommandBuffer.SetComputeFloatParamsCommandBuffer.SetComputeTextureParamCommandBuffer.SetComputeVectorParamCommandBuffer.WaitOnGPUFenceAll of the commands within the buffer are guaranteed to be executed on the same queue. If the target platform does not support async compute queues then the work is dispatched on the graphics queue.
SetupCameraPropertiesSetup camera specific global shader variables.
StartMultiEyeFine-grain control to begin stereo rendering on the scriptable render context.
StereoEndRenderIndicate completion of stereo rendering on a single frame.
StopMultiEyeStop stereo rendering on the scriptable render context.
SubmitSubmit rendering loop for execution.

Static Methods

EmitWorldGeometryForSceneViewEmit UI geometry into the scene view for rendering.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答