I've been using a script to create a new vignette effect. I am able to get it to create the profile, but it never shows the vignette on the actual game screen. On the inspector I am able to see very clearly that the effect is there and enabled, but it still won't update. I have the effects on my main camera. The image shows what it looks like in the inspector.
![inspector][1]
My script is written like this:
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class CameraScript : MonoBehaviour
{
// * Changes vignette
Volume vol;
Vignette vg;
void Awake()
{
vol = gameObject.GetComponent();
vg = vol.profile.Add();
vg.color = new ColorParameter(Color.red, true);
vg.intensity = new ClampedFloatParameter(.6f, .5f, .7f, true);
vg.smoothness = new ClampedFloatParameter(.2f, .15f, .25f, true);
}
}
Does anyone have any idea how to fix this?
[1]: /storage/temp/202239-screenshot-2022-11-25-105932.png
↧