Created
June 22, 2022 18:40
-
-
Save TheCuttlefish/8e5efeaf53ee7bbe1b0c5b61e0d935ec to your computer and use it in GitHub Desktop.
Unity URP control of post processing effects (example aberration) 2019
This file contains 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; | |
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