Quantcast
Channel: Questions in topic: "post processing"
Viewing all articles
Browse latest Browse all 713

How to manipulate PostProcessing effects settings during execution with c#?

$
0
0
I need to change the intensity value of my current Vignette effect depending in specific conditions.
So far I haven't been able to achieve this. Please help!

*Image of what I want to achieve:*
![alt text][1]
*My setup:*
- Unity 2019.3.5f1 with URP implemented - Post Processing Package (v2) installed - Scene with a GameObject + Volume component with Vignette and Bloom effect overrides added - A monobehaviour component script in the very same GameObject from above
*My monobehaviour script:* using UnityEngine; using UnityEngine.Rendering.PostProcessing; public class PostProcessingHandler : MonoBehaviour { private PostProcessVolume _ppv; private Vignette _vignette; // Vignette intensity values [SerializeField, Range(0f, 1f)] private float _lowIntensity = 0.25f; [SerializeField, Range(0f, 1f)] private float _highIntensity = 0.5f; private void Start() { _ppv = GetComponent(); Debug.Log(_ppv); } }
When I try to retrieve PostProcessingVolume component to get it's profile (and further layer manipulation) I always get **"null"**.

*Image of my setup:* ![alt text][2]
I've seen several guides/posts and even Unity documentation but I cannot get past that starting point of getting the PostProcessingVolume component, what am i missing?

[1]: /storage/temp/154373-desire.jpg [2]: /storage/temp/154374-question.jpg

Viewing all articles
Browse latest Browse all 713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>