- Home /
How to Assign FloatParameter
I want to use a float from a sliders value to change the Ambient Occlusion Intensity, how do I pass the float value into the Ambient Occlusion?
Here is what I'm trying now. This is a Dynamic Float assigned to the slider.
public void SetAmbientOcclusion(float f)
{
ambientOcclusionIntensity.value = f;
PlayerPrefs.SetFloat("AOIntensity", f);
AmbientOcclusion aO = null;
ppv.profile.TryGetSettings(out aO);
FloatParameter fP = new FloatParameter {value = f}; //the fp not getting set
aO.intensity = fP;
Debug.Log(fP);
ambientOcclusionIntensityText.text = "Intensity : " + f.ToString("F2");
PlayerPrefs.SetFloat("AOIntensity", f);
}
My working assumption is that
FloatParameter fP = new FloatParameter {value = f}; is not correct.
Answer by Llama_w_2Ls · Dec 15, 2020 at 05:15 PM
You can just use a0.intensity.value = f;
and it works just fine. I've never needed to use a float parameter when working with the PPStack before. @Razputin
Your answer
Follow this Question
Related Questions
PlayerPrefs not saving slider data 3 Answers
Change Post Process Volume Color Grading at runtime 0 Answers
How to manipulate PostProcessing effects settings during execution with c#? 1 Answer
Changing URP Volume values in code not working 0 Answers
Post Processing Effects not working despite correctly converting project to URP 0 Answers