Class DepthOnlyPass
Render all objects that have a 'DepthOnly' pass into the given depth buffer.
You can use this pass to prime a depth buffer for subsequent rendering. Use it as a z-prepass, or use it to generate a depth buffer.
Inherited Members
Namespace: UnityEngine.Rendering.Universal.Internal
Syntax
public class DepthOnlyPass : ScriptableRenderPass
Constructors
DepthOnlyPass(RenderPassEvent, RenderQueueRange, LayerMask)
Create the DepthOnlyPass
Declaration
public DepthOnlyPass(RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
RenderPassEvent | evt | |
RenderQueueRange | renderQueueRange | |
LayerMask | layerMask |
Methods
Execute(ScriptableRenderContext, ref RenderingData)
Execute the pass. This is where custom rendering occurs. Specific details are left to the implementation
Declaration
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderContext | context | Use this render context to issue any draw commands during execution |
RenderingData | renderingData | Current rendering state information |
Overrides
OnCameraSetup(CommandBuffer, ref RenderingData)
Declaration
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | |
RenderingData | renderingData |
Overrides
Setup(RenderTextureDescriptor, RTHandle)
Configure the pass
Declaration
public void Setup(RenderTextureDescriptor baseDescriptor, RTHandle depthAttachmentHandle)
Parameters
Type | Name | Description |
---|---|---|
RenderTextureDescriptor | baseDescriptor | |
RTHandle | depthAttachmentHandle |