How to access of component HDRI Sky "exposure" in C# ?

Hello everyone,

Everything is in the title.

How I can access to exposure variable in the component HDRI Sky in C# ?

Best regards,

Alexandre

Ok I have find the solution.

Add this at the top of your script:
using UnityEngine.Rendering.HighDefinition;
----------
Add this variables:
public Volume HDRIVolume; (Drag and drop the volume in your inspector)
public HDRISky HDRISkyExposure; (Find at awake / start below)
----------
Add this in your void awake / start to get the variable HDRISky*:*
if (HDRIVolume.profile.TryGet(out HDRISky tempE)) {
HDRISkyExposure = tempE;
}

To change the value of the HDRI sky exposure:
HDRISkyExposure.exposure.value = your float;
Bye everyone :slight_smile:

6 Likes

Thanks, I did this too but i dont see anythin change, is it adjusting exposure compensation? why does the brightness not change.

edit, oh it works! just had to restart game, thanks!