WENZHAO LI
  • Home
  • Modeling
  • TechArtBlog
  • PythonMAYA
  • About

TechART Blog

Rack Focus For The HDRP and NEW postprocessing Stack V2

11/22/2018

0 Comments

 
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 Comments



Leave a Reply.

    Author

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

    Archives

    January 2021
    November 2020
    October 2019
    September 2019
    February 2019
    November 2018
    July 2018
    February 2018

    Categories

    All

    RSS Feed

© COPYRIGHT 2019. ALL RIGHTS RESERVED.
  • Home
  • Modeling
  • TechArtBlog
  • PythonMAYA
  • About