Created
May 14, 2021 13:38
-
-
Save TheCuttlefish/cdb9071340eb2f629ad73ec40b3419c0 to your computer and use it in GitHub Desktop.
Post processing control via script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering.PostProcessing; | |
public class PostScript : MonoBehaviour | |
{ | |
PostProcessVolume volume; | |
ChromaticAberration chroAb; | |
ColorGrading cGrad; | |
void Start() | |
{ | |
volume = gameObject.GetComponent<PostProcessVolume>(); | |
chroAb = volume.profile.GetSetting<ChromaticAberration>(); | |
cGrad = volume.profile.GetSetting<ColorGrading>(); | |
} | |
void Update() | |
{ | |
chroAb.intensity.value = Mathf.Abs( Mathf.Sin(Time.time) ) * 10; | |
cGrad.hueShift.value = Mathf.Abs(Mathf.Sin(Time.time))*180; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment