Call for a sky environment update from a script?

Can anyone give me a code example, I cant find a working example for this in any documentation.

Hi @Kamichalik ,

What do you exactly mean with “call for a sky environment update”? You want to change some value, or exactly what?

Regarding the parameter changes, sky works just the same way as other Volume framework adjustments. You get the correct component, then adjust it’s settings. You probably didn’t search enough if you didn’t find examples.

Here’s one old one I wrote: [HDRP][2019.1] How Do You Change Effects Volume Overrides Through Script?

In the new HDRP Gradient Sky, it has an exposure variable, which can be edited and affects the colour of the unlit areas of models from the direction light, whenever the exposure value is changed it will not have any effect until SkyEnvironmentUpdate() is called from the HDRenderPipeline Class, this can be done automatically is you select the realtime option on your gradient sky update mode, but there is another option called OnDemand(), when OnDemand is the selected option, you need to manually call SkyEnvironmentUpdate(), now this function is not static and requires an actual instance of the HDRenderPipeline Class, which i have no clue how to get, which is my question, where do i get a reference to this object.

Ok I see now. Any reason you can’t use that realtime update, if it works? (EDIT or On Changed.)

Here is what I’m doing

if (RenderPipelineManager.currentPipeline is HDRenderPipeline) {
    HDRenderPipeline hd = (HDRenderPipeline)RenderPipelineManager.currentPipeline;
    hd.RequestSkyEnvironmentUpdate();
}