본문 바로가기

Unity

Unity RP에서 Volum 접근 코드

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

public class environmentHandler : MonoBehaviour
{
    public Volume Volume;
    public float LF_Instensity;
     VolumeProfile volumeProfile;

    // Start is called before the first frame update
    void Start()
    {
        volumeProfile = Volume.profile;
    }

    // Update is called once per frame
    void Update()
    {
        if (volumeProfile == null)
            volumeProfile = Volume.profile;

        
        UnityEngine.Rendering.HighDefinition.Bloom lensEffect;
        volumeProfile.TryGet(out lensEffect);
        if (lensEffect == null)
        {
            Debug.Log("Null");
            return;
        }
        lensEffect.dirtIntensity.value = LF_Instensity;
    }
}

'Unity' 카테고리의 다른 글

운동학 방적식  (0) 2021.01.06
포물선 궤적그리기  (0) 2021.01.04
Azure-Kinect-Unity-Sample  (0) 2020.08.04
[Unity] High-Definition RP 프로젝트시 주의 사항.  (0) 2020.07.20
유니티 외부 프로그램 실행 방법  (0) 2020.07.20