Last active
March 17, 2022 00:28
-
-
Save seckincengiz/68830456d00445ded1416010b30e9788 to your computer and use it in GitHub Desktop.
Controlling post processing effects using scripts
This file contains hidden or 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 UnityEngine.Rendering.PostProcessing; | |
public PostProcessVolume pVolume; | |
public Slider occSlider; | |
public class PostProcessingManager : MonoBehaviour | |
{ | |
private void SetPostProcessing() | |
{ | |
if(pVolume.profile.TryGetSettings<AmbientOcclusion>(out var occ)) | |
{ | |
occ.intensity.overrideState = true; | |
occ.intensity.value = new FloatParameter { value = 3f }; | |
// slider | |
//occ.intensity.value = new FloatParameter { value = occSlider.value }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment