Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
Created June 22, 2022 18:40
Show Gist options
  • Save TheCuttlefish/8e5efeaf53ee7bbe1b0c5b61e0d935ec to your computer and use it in GitHub Desktop.
Save TheCuttlefish/8e5efeaf53ee7bbe1b0c5b61e0d935ec to your computer and use it in GitHub Desktop.
Unity URP control of post processing effects (example aberration) 2019
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class PostControl : MonoBehaviour
{
public Volume volume;
public ChromaticAberration aberration;
void Start()
{
Volume volume = gameObject.GetComponent<Volume>();
ChromaticAberration tmp;
if (volume.profile.TryGet<ChromaticAberration>(out tmp))
{
aberration = tmp;
}
}
void Update()
{
aberration.intensity.Override(2 + Mathf.Cos (Time.time * 10) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment