{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method SetAOVRequests | High Definition RP | 10.5.0
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Method SetAOVRequests

    SetAOVRequests(AOVRequestDataCollection)

    Set AOV requests to use.

    선언
    public void SetAOVRequests(AOVRequestDataCollection aovRequests)
    파라미터
    타입 이름 설명
    AOVRequestDataCollection aovRequests

    Describes the requests to execute.

    예
    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
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)