docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ScriptableRenderer

    Class ScriptableRenderer implements a rendering strategy. It describes how culling and lighting works and the effects supported.

    TODO RENDERGRAPH: UPDATE THIS DOC FOR THE RENDERGRAPH PATH A renderer can be used for all cameras or be overridden on a per-camera basis. It will implement light culling and setup and describe a list of ScriptableRenderPass to execute in a frame. The renderer can be extended to support more effect with additional ScriptableRendererFeature. Resources for the renderer are serialized in ScriptableRendererData.

    The renderer resources are serialized in ScriptableRendererData. ScriptableRendererData ScriptableRendererFeature ScriptableRenderPass

    Inheritance
    object
    ScriptableRenderer
    UniversalRenderer
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering.Universal
    Assembly: Unity.RenderPipelines.Universal.Runtime.dll
    Syntax
    public abstract class ScriptableRenderer : IDisposable

    Constructors

    Name Description
    ScriptableRenderer(ScriptableRendererData)

    Creates a new ScriptableRenderer instance.

    Fields

    Name Description
    k_CameraTarget

    The RTHandle for the Camera Target.

    Properties

    Name Description
    activeRenderPassQueue

    Returns a list of render passes scheduled to be executed by this renderer. ScriptableRenderPass

    cameraColorTargetHandle

    Returns the camera color target for this renderer. It's only valid to call cameraColorTarget in the scope of ScriptableRenderPass. ScriptableRenderPass.

    cameraDepthTargetHandle

    Returns the camera depth target for this renderer. It's only valid to call cameraDepthTarget in the scope of ScriptableRenderPass. ScriptableRenderPass.

    profilingExecute

    Override to provide a custom profiling name

    rendererFeatures

    Returns a list of renderer features added to this renderer. ScriptableRendererFeature

    supportedRenderingFeatures

    Supported rendering features by this renderer. SupportedRenderingFeatures

    unsupportedGraphicsDeviceTypes

    List of unsupported Graphics APIs for this renderer. unsupportedGraphicsDeviceTypes

    Methods

    Name Description
    ConfigureCameraTarget(RTHandle, RTHandle)

    Configures the camera target.

    Dispose()

    Disposable pattern implementation. Cleans up resources used by the renderer.

    Dispose(bool)

    Called by Dispose(). Override this function to clean up resources in your renderer. Be sure to call this base dispose in your overridden function to free resources allocated by the base.

    EnqueuePass(ScriptableRenderPass)

    Enqueues a render pass for execution.

    Execute(ScriptableRenderContext, ref RenderingData)

    Execute the enqueued render passes. This automatically handles editor and stereo rendering.

    FinishRendering(CommandBuffer)

    Called upon finishing rendering the camera stack. You can release any resources created by the renderer here.

    GetCameraClearFlag(ref CameraData)

    Returns a clear flag based on CameraClearFlags.

    SetCameraMatrices(CommandBuffer, ref CameraData, bool)

    Set camera matrices. This method will set UNITY_MATRIX_V, UNITY_MATRIX_P, UNITY_MATRIX_VP to camera matrices. Additionally this will also set unity_CameraProjection and unity_CameraProjection. If setInverseMatrices is set to true this function will also set UNITY_MATRIX_I_V and UNITY_MATRIX_I_VP. This function has no effect when rendering in stereo. When in stereo rendering you cannot override camera matrices. If you need to set general purpose view and projection matrices call SetViewAndProjectionMatrices(CommandBuffer, Matrix4x4, Matrix4x4, bool) instead.

    Setup(ScriptableRenderContext, ref RenderingData)

    Configures the render passes that will execute for this renderer. This method is called per-camera every frame.

    SetupCullingParameters(ref ScriptableCullingParameters, ref CameraData)

    Override this method to configure the culling parameters for the renderer. You can use this to configure if lights should be culled per-object or the maximum shadow distance for example.

    SetupLights(ScriptableRenderContext, ref RenderingData)

    Override this method to implement the lighting setup for the renderer. You can use this to compute and upload light CBUFFER for example.

    SetupRenderPasses(in RenderingData)

    Calls Setup for each feature added to this renderer. SetupRenderPasses(ScriptableRenderer, in RenderingData)

    SupportedCameraStackingTypes()

    This setting controls if the camera editor should display the camera stack category. If your renderer is not supporting stacking this one should return 0. For the UI to show the Camera Stack widget this must support CameraRenderType.Base. CameraRenderType

    SupportsCameraStackingType(CameraRenderType)

    Check if the given camera render type is supported in the renderer's current state.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)