How to alter Vignetting value on Vignette and Chromatic Aberration via C# Script
I'm trying to change the value of "Vignetting" in the Image Effects script: Vignette and Chromatic Aberration.
For some reason, it's acting like the parameter does not exist or that I do not have access to it.
I've tried some other solutions but with no luck. http://answers.unity3d.com/questions/1018636/how-can-you-access-and-change-the-values-of-the-vi.html http://answers.unity3d.com/questions/582509/calling-vignetting-js-shader-from-c-code.html
Noteworthy Code:
using UnityStandardAssets.ImageEffects;
vis = GetComponentInChildren<VignetteAndChromaticAberration>();
vis.Vignetting = value; // <--- Doesn't Work
The error says "there is no definition for Vignetting" in the component.
Anyone have any ideas?
Answer by ChronoGames · May 04, 2016 at 01:10 AM
If anyone else finds themselves here, the solution is to edit the "intensity" instead. It's on a scale from 0 to 1.
@ChronoGames thanks! I found myself here looking for answer to this question, and your solution worked nicely :)
Answer by rrabassa · Mar 01, 2017 at 02:33 PM
I can't seem to get this to work... No errors but no change either:
_fps.GetComponentInChildren<VignetteAndChromaticAberration> ().intensity = 10;
@$$anonymous$$abassa Its between a scale of 0-1. 10 would simply clamp it to 1. Try putting values between 0 and 1 such as 0.1 for 10% effect.