Question by
tuddor1234 · Oct 15, 2019 at 09:30 AM ·
renderingskyboxhdr
How to change HDRI SKY dinamiclly?
So, I have a project where I want to be able to change between many skys, and it's made in HDRP so I can't use the normal SkyBox aproach. I found out how to change the default HDRI Sky, but if try to do it in code, I get a strange ERROR.
Any ideas?
help.png
(16.5 kB)
Comment
Answer by Ava42 · Feb 04 at 02:31 PM
Declare:
public VolumeProfile HDRP_profile;
HDRISky HDRP_sky;
public UnityEngine.Rendering.CubemapParameter CustomSkyBox;
on awake:
HDRP_profile.TryGet<HDRISky>(out HDRP_sky);
when need:
HDRP_sky.hdriSky.SetValue(CustomSkyBox);