Class HDAdditionalCameraData | High Definition RP | 9.0.0-preview.71
docs.unity3d.com
    Show / Hide Table of Contents

    Class HDAdditionalCameraData

    Additional component that holds HDRP specific parameters for Cameras.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    HDAdditionalCameraData
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Component.rigidbody
    Component.rigidbody2D
    Component.camera
    Component.light
    Component.animation
    Component.constantForce
    Component.renderer
    Component.audio
    Component.networkView
    Component.collider
    Component.collider2D
    Component.hingeJoint
    Component.particleSystem
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: UnityEngine.Rendering.HighDefinition
    Syntax
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@9.0/manual/HDRP-Camera.html")]
    [DisallowMultipleComponent]
    [ExecuteAlways]
    [RequireComponent(typeof(Camera))]
    public class HDAdditionalCameraData : MonoBehaviour, IFrameSettingsHistoryContainer, IDebugData, IVersionable<HDAdditionalCameraData.Version>

    Fields

    allowDynamicResolution

    Allows dynamic resolution on buffers linked to this camera.

    Declaration
    [Tooltip("Allows dynamic resolution on buffers linked to this camera.")]
    public bool allowDynamicResolution
    Field Value
    Type Description
    Boolean

    antialiasing

    Anti-aliasing mode.

    Declaration
    public HDAdditionalCameraData.AntialiasingMode antialiasing
    Field Value
    Type Description
    HDAdditionalCameraData.AntialiasingMode

    backgroundColorHDR

    HDR color used for clearing the camera background.

    Declaration
    [ColorUsage(true, true)]
    public Color backgroundColorHDR
    Field Value
    Type Description
    Color

    clearColorMode

    Clear mode for the camera background.

    Declaration
    public HDAdditionalCameraData.ClearColorMode clearColorMode
    Field Value
    Type Description
    HDAdditionalCameraData.ClearColorMode

    clearDepth

    Clear depth as well as color.

    Declaration
    public bool clearDepth
    Field Value
    Type Description
    Boolean

    customRenderingSettings

    Allows you to override the default frame settings for this camera.

    Declaration
    [Tooltip("Allows you to override the default settings for this camera.")]
    public bool customRenderingSettings
    Field Value
    Type Description
    Boolean

    defaultFrameSettings

    When using default frame settings, specify which type of frame settings to use.

    Declaration
    public FrameSettingsRenderType defaultFrameSettings
    Field Value
    Type Description
    FrameSettingsRenderType

    dithering

    Use dithering to filter out minor banding.

    Declaration
    public bool dithering
    Field Value
    Type Description
    Boolean

    flipYMode

    Vertical flip mode.

    Declaration
    public HDAdditionalCameraData.FlipYMode flipYMode
    Field Value
    Type Description
    HDAdditionalCameraData.FlipYMode

    fullscreenPassthrough

    Skips rendering settings to directly render in fullscreen (Useful for video).

    Declaration
    [Tooltip("Skips rendering settings to directly render in fullscreen (Useful for video).")]
    public bool fullscreenPassthrough
    Field Value
    Type Description
    Boolean

    hasPersistentHistory

    Enable to retain history buffers even if the camera is disabled.

    Declaration
    public bool hasPersistentHistory
    Field Value
    Type Description
    Boolean

    invertFaceCulling

    Invert face culling.

    Declaration
    public bool invertFaceCulling
    Field Value
    Type Description
    Boolean

    nonObliqueProjectionGetter

    Specify a custom getter for non oblique projection matrix.

    Declaration
    public HDAdditionalCameraData.NonObliqueProjectionGetter nonObliqueProjectionGetter
    Field Value
    Type Description
    HDAdditionalCameraData.NonObliqueProjectionGetter

    physicalParameters

    Physical camera parameters.

    Declaration
    public HDPhysicalCamera physicalParameters
    Field Value
    Type Description
    HDPhysicalCamera

    probeLayerMask

    Probe layer mask.

    Declaration
    public LayerMask probeLayerMask
    Field Value
    Type Description
    LayerMask

    renderingPathCustomFrameSettingsOverrideMask

    Mask specifying which frame settings are overridden when using custom frame settings.

    Declaration
    public FrameSettingsOverrideMask renderingPathCustomFrameSettingsOverrideMask
    Field Value
    Type Description
    FrameSettingsOverrideMask

    SMAAQuality

    Quality of the anti-aliasing when using SMAA.

    Declaration
    public HDAdditionalCameraData.SMAAQualityLevel SMAAQuality
    Field Value
    Type Description
    HDAdditionalCameraData.SMAAQualityLevel

    stopNaNs

    Use a pass to eliminate NaNs contained in the color buffer before post-processing.

    Declaration
    public bool stopNaNs
    Field Value
    Type Description
    Boolean

    taaAntiFlicker

    Drive the anti-flicker mechanism. With high values flickering might be reduced, but it can lead to more ghosting or disocclusion artifacts.

    Declaration
    [Range(0F, 1F)]
    public float taaAntiFlicker
    Field Value
    Type Description
    Single

    taaAntiHistoryRinging

    When enabled, ringing artifacts (dark or strangely saturated edges) caused by history sharpening will be improved. This comes at a potential loss of sharpness upon motion.

    Declaration
    public bool taaAntiHistoryRinging
    Field Value
    Type Description
    Boolean

    taaHistorySharpening

    Strength of the sharpening of the history sampled for TAA.

    Declaration
    [Range(0F, 1F)]
    public float taaHistorySharpening
    Field Value
    Type Description
    Single

    taaMotionVectorRejection

    Larger is this value, more likely history will be rejected when current and reprojected history motion vector differ by a substantial amount. Larger values can decrease ghosting but will also reintroduce aliasing on the aforementioned cases.

    Declaration
    [Range(0F, 1F)]
    public float taaMotionVectorRejection
    Field Value
    Type Description
    Single

    TAAQuality

    Quality of the anti-aliasing when using TAA.

    Declaration
    public HDAdditionalCameraData.TAAQualityLevel TAAQuality
    Field Value
    Type Description
    HDAdditionalCameraData.TAAQualityLevel

    taaSharpenStrength

    Strength of the sharpening component of temporal anti-aliasing.

    Declaration
    [Range(0F, 2F)]
    public float taaSharpenStrength
    Field Value
    Type Description
    Single

    volumeAnchorOverride

    Optional transform override for the position where volumes are interpolated.

    Declaration
    public Transform volumeAnchorOverride
    Field Value
    Type Description
    Transform

    volumeLayerMask

    Layer mask used to select which volumes will influence this camera.

    Declaration
    [Tooltip("LayerMask HDRP uses for Volume interpolation for this Camera.")]
    public LayerMask volumeLayerMask
    Field Value
    Type Description
    LayerMask

    xrRendering

    Enable XR rendering.

    Declaration
    public bool xrRendering
    Field Value
    Type Description
    Boolean

    Properties

    aovRequests

    Use this property to get the aov requests.

    It is never null.

    Declaration
    public IEnumerable<AOVRequestData> aovRequests { get; }
    Property Value
    Type Description
    IEnumerable<AOVRequestData>

    hasCustomRender

    True if any Custom Render event is registered for this camera.

    Declaration
    public bool hasCustomRender { get; }
    Property Value
    Type Description
    Boolean

    isEditorCameraPreview

    Unity support two type of preview: Camera preview and material preview. This property allow to know that we are an editor camera preview when the type is preview.

    Declaration
    public bool isEditorCameraPreview { get; }
    Property Value
    Type Description
    Boolean

    renderingPathCustomFrameSettings

    Custom frame settings.

    Declaration
    public FrameSettings renderingPathCustomFrameSettings { get; }
    Property Value
    Type Description
    FrameSettings

    Methods

    CopyTo(HDAdditionalCameraData)

    Copy HDAdditionalCameraData.

    Declaration
    public void CopyTo(HDAdditionalCameraData data)
    Parameters
    Type Name Description
    HDAdditionalCameraData data

    Component to copy to.

    GetGraphicsBuffer(HDAdditionalCameraData.BufferAccessType)

    Returns the requested graphics buffer. Users should use the requestGraphicsBuffer event to make sure that the required buffers are requested first. Note that depending on the current frame settings some buffers may not be available.

    Declaration
    public RTHandle GetGraphicsBuffer(HDAdditionalCameraData.BufferAccessType type)
    Parameters
    Type Name Description
    HDAdditionalCameraData.BufferAccessType type

    Type of the requested buffer.

    Returns
    Type Description
    RTHandle

    Requested buffer as a RTHandle. Can be null if the buffer is not available.

    GetNonObliqueProjection(Camera)

    Returns the non oblique projection matrix for this camera.

    Declaration
    public Matrix4x4 GetNonObliqueProjection(Camera camera)
    Parameters
    Type Name Description
    Camera camera

    Requested camera.

    Returns
    Type Description
    Matrix4x4

    The non oblique projection matrix for this camera.

    SetAOVRequests(AOVRequestDataCollection)

    Set AOV requests to use.

    Declaration
    public void SetAOVRequests(AOVRequestDataCollection aovRequests)
    Parameters
    Type Name Description
    AOVRequestDataCollection aovRequests

    Describes the requests to execute.

    Examples
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Rendering;
    using UnityEngine.Rendering.HighDefinition;
    using UnityEngine.Rendering.HighDefinition.Attributes;
    
    [ExecuteAlways]
    [RequireComponent(typeof(Camera))]
    [RequireComponent(typeof(HDAdditionalCameraData))]
    public class SetupAOVCallbacks : MonoBehaviour
    {
        private static RTHandle m_ColorRT;
    
        [SerializeField] private Texture m_Target;
        [SerializeField] private DebugFullScreen m_DebugFullScreen;
        [SerializeField] private DebugLightFilterMode m_DebugLightFilter;
        [SerializeField] private MaterialSharedProperty m_MaterialSharedProperty;
        [SerializeField] private LightingProperty m_LightingProperty;
        [SerializeField] private AOVBuffers m_BuffersToCopy;
        [SerializeField] private List<GameObject> m_IncludedLights;
    
    
        void OnEnable()
        {
            var aovRequest = new AOVRequest(AOVRequest.NewDefault())
                .SetLightFilter(m_DebugLightFilter);
            if (m_DebugFullScreen != DebugFullScreen.None)
                aovRequest = aovRequest.SetFullscreenOutput(m_DebugFullScreen);
            if (m_MaterialSharedProperty != MaterialSharedProperty.None)
                aovRequest = aovRequest.SetFullscreenOutput(m_MaterialSharedProperty);
            if (m_LightingProperty != LightingProperty.None)
                aovRequest = aovRequest.SetFullscreenOutput(m_LightingProperty);
    
            var add = GetComponent<HDAdditionalCameraData>();
            add.SetAOVRequests(
                new AOVRequestBuilder()
                    .Add(
                        aovRequest,
                        bufferId => m_ColorRT ?? (m_ColorRT = RTHandles.Alloc(512, 512)),
                        m_IncludedLights.Count > 0 ? m_IncludedLights : null,
                        new []{ m_BuffersToCopy },
                        (cmd, textures, properties) =>
                        {
                            if (m_Target != null)
                                cmd.Blit(textures[0], m_Target);
                        })
                    .Build()
            );
        }
    
        private void OnGUI()
        {
            GUI.DrawTexture(new Rect(10, 10, 512, 256), m_Target);
        }
    
        void OnDisable()
        {
            var add = GetComponent<HDAdditionalCameraData>();
            add.SetAOVRequests(null);
        }
    
        void OnValidate()
        {
            OnDisable();
            OnEnable();
        }
    }

    Example use case:

    • Export Normals: use MaterialSharedProperty.Normals and AOVBuffers.Color
    • Export Color before post processing: use AOVBuffers.Color
    • Export Color after post processing: use AOVBuffers.Output
    • Export Depth stencil: use AOVBuffers.DepthStencil
    • Export AO: use MaterialSharedProperty.AmbientOcclusion and AOVBuffers.Color

    Events

    customRender

    Event used to override HDRP rendering for this particular camera.

    Declaration
    public event Action<ScriptableRenderContext, HDCamera> customRender
    Event Type
    Type Description
    Action<ScriptableRenderContext, HDCamera>

    requestGraphicsBuffer

    RequestAccessDelegate used to request access to various buffers of this camera.

    Declaration
    public event HDAdditionalCameraData.RequestAccessDelegate requestGraphicsBuffer
    Event Type
    Type Description
    HDAdditionalCameraData.RequestAccessDelegate

    Explicit Interface Implementations

    IVersionable<HDAdditionalCameraData.Version>.version

    Declaration
    HDAdditionalCameraData.Version IVersionable<HDAdditionalCameraData.Version>.version { get; set; }
    Returns
    Type Description
    HDAdditionalCameraData.Version
    Implements
    IVersionable<TVersion>.version
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023