Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
Created May 14, 2021 13:38
Show Gist options
  • Save TheCuttlefish/cdb9071340eb2f629ad73ec40b3419c0 to your computer and use it in GitHub Desktop.
Save TheCuttlefish/cdb9071340eb2f629ad73ec40b3419c0 to your computer and use it in GitHub Desktop.
Post processing control via script
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