docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GPUResidentDrawer

    Static utility class for updating data post cull in begin camera rendering

    Inheritance
    object
    GPUResidentDrawer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.GPUDriven.Runtime.dll
    Syntax
    public class GPUResidentDrawer

    Methods

    InstanceOcclusionTest(RenderGraph, in OcclusionCullingSettings, ReadOnlySpan<SubviewOcclusionTest>)

    Utility function to run an occlusion test in compute to update indirect draws. This function will dispatch compute shaders to run the given occlusion test and update all indirect draws in the culling output for the given view. The next time a renderer list that uses this culling output is drawn, these indirect draw commands will contain only the instances that passed the given occlusion test.

    Declaration
    public static void InstanceOcclusionTest(RenderGraph renderGraph, in OcclusionCullingSettings settings, ReadOnlySpan<SubviewOcclusionTest> subviewOcclusionTests)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph that will have a compute pass added.

    OcclusionCullingSettings settings

    The view to update and occlusion test to use.

    ReadOnlySpan<SubviewOcclusionTest> subviewOcclusionTests

    Specifies the occluder subviews to use with each culling split index.

    IsInstanceOcclusionCullingEnabled()

    Utility function to test if instance occlusion culling is enabled

    Declaration
    public static bool IsInstanceOcclusionCullingEnabled()
    Returns
    Type Description
    bool

    True if instance occlusion culling is enabled

    OnSetupAmbientProbe()

    Utility function for updating probe data after global ambient probe is set up

    Declaration
    public static void OnSetupAmbientProbe()

    PostCullBeginCameraRendering(RenderRequestBatcherContext)

    Utility function for updating data post cull in begin camera rendering

    Declaration
    public static void PostCullBeginCameraRendering(RenderRequestBatcherContext context)
    Parameters
    Type Name Description
    RenderRequestBatcherContext context

    Context containing the data to be set

    ReinitializeIfNeeded()

    Enable or disable GPUResidentDrawer based on the project settings. We call this every frame because GPUResidentDrawer can be enabled/disabled by the settings outside the render pipeline asset.

    Declaration
    public static void ReinitializeIfNeeded()

    RenderDebugOccluderOverlay(RenderGraph, DebugDisplayGPUResidentDrawer, Vector2, float, TextureHandle)

    Utility function visualise the occluder pyramid in a debug overlay.

    Declaration
    public static void RenderDebugOccluderOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, Vector2 screenPos, float maxHeight, TextureHandle colorBuffer)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph that will have a compute pass added.

    DebugDisplayGPUResidentDrawer debugSettings

    The rendering debugger debug settings to read parameters from.

    Vector2 screenPos

    The screen position to render the overlay at.

    float maxHeight

    The maximum screen height of the overlay.

    TextureHandle colorBuffer

    The color buffer to render the overlay on.

    RenderDebugOcclusionTestOverlay(RenderGraph, DebugDisplayGPUResidentDrawer, int, TextureHandle)

    Utility function to render an occlusion test heatmap debug overlay.

    Declaration
    public static void RenderDebugOcclusionTestOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, int viewInstanceID, TextureHandle colorBuffer)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph that will have a compute pass added.

    DebugDisplayGPUResidentDrawer debugSettings

    The rendering debugger debug settings to read parameters from.

    int viewInstanceID

    The instance ID of the camera using a GPU occlusion test.

    TextureHandle colorBuffer

    The color buffer to render the overlay on.

    UpdateInstanceOccluders(RenderGraph, in OccluderParameters, ReadOnlySpan<OccluderSubviewUpdate>)

    Utility function used to update occluders using a depth buffer. This function will dispatch compute shaders to read the given depth buffer and build a mip pyramid of closest depths for use during occlusion culling. The next time an occlusion test is issed for this view, instances will be tested against the updated occluders.

    Declaration
    public static void UpdateInstanceOccluders(RenderGraph renderGraph, in OccluderParameters occluderParameters, ReadOnlySpan<OccluderSubviewUpdate> occluderSubviewUpdates)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph that will have a compute pass added.

    OccluderParameters occluderParameters

    Parameter to specify the view and depth buffer to read.

    ReadOnlySpan<OccluderSubviewUpdate> occluderSubviewUpdates

    Specifies which occluder subviews to update from slices of the input depth buffer.

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)