WENZHAO LI
  • Home
  • Modeling
  • TechArtBlog
  • About

TechART Blog

Rack Focus For The HDRP and NEW postprocessing Stack V2

11/22/2018

0 评论

 
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
// make sure you add this to enable the Unity Postprocessing library


public class VignettePulse : MonoBehaviour
//name the Script the Way you want

{
    PostProcessVolume m_Volume;
//A customized PostProcessVolume and its profile

    Vignette m_Vignette;
// A customized instance of the profile and its settings

    void Start()
    {
        m_Vignette = ScriptableObject.CreateInstance<Vignette>();
        m_Vignette.enabled.Override(
true);
        m_Vignette.intensity.Override(
1f);
//Name the setting, attach it with a temp scriptable game object

        m_Volume = PostProcessManager.instance.QuickVolume(gameObject.layer,
100f, m_Vignette);
// Assign this to the volume, make sure you got the layer correct. Currently it will read the layer of the game object it is attaching.
    }

   
void Update()
   
{
        m_Vignette.intensity.
value = Mathf.Sin(Time.realtimeSinceStartup);
    }

   
void Destroy()
   
{
        RuntimeUtilities.DestroyVolume(m_Volume,
true);
    }
}



https://docs.unity3d.com/Packages/com.unity.postprocessing@2.0/manual/Manipulating-the-Stack.html

0 评论



写评论。

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    November 2021
    September 2021
    August 2021
    July 2021
    June 2021
    April 2021
    January 2021
    November 2020
    October 2019
    September 2019
    February 2019
    November 2018
    July 2018
    February 2018

    Categories

    All

    RSS Feed

Powered by 通过可定制的模板创建自己独特的网站。
  • Home
  • Modeling
  • TechArtBlog
  • About