Archive for February, 2018

Changing parameters through scripting on Unity’s post processing stack V2.

February 13 | 18

For my PhD thesis I need to write an image effect that lets me configure a lens on a screen, but honestly, I can’t stop playing Archery Pro. In the calibration phase I need to modify the Image effect values through scripting.

To my surprise; there is a tutorial for doing changes in V1 that you can check here or in a forum post here but for V2 there where no guides.

Luckily enough, the forum post gave helped me out getting started to modify values on the Post Processing stack V2.

 

So lets say you have an image effect called “PitchTestImgEffect.cs”

Easy enough, my image effect has 2 float values and a texture as you can see here:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What we need to do is to access the PostProcessVolume and get the PostProcessEffectSettings that contains our “PitchTestImgEffect” class, then we can modify its settings :-).

So with this script we can access the value of the pitch and set a value to it:

Hopefully this helps you out :). If it helped you, drop me a line and let me know.