Skip to content

Instantly share code, notes, and snippets.

@seckincengiz
Last active March 17, 2022 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seckincengiz/68830456d00445ded1416010b30e9788 to your computer and use it in GitHub Desktop.
Save seckincengiz/68830456d00445ded1416010b30e9788 to your computer and use it in GitHub Desktop.
Controlling post processing effects using scripts
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