I had time to hack this for 2 hours and I think I got my own sky there in the menus and at least something is rendering. But this required me to hard code many of the variables and change a few things here and there…
Maybe someone from Unity could clarify how this is supposed to be done correctly? Or is this currently not officially supported?
I just reworked my custom skybox yesterday to be compatible with HDRP 7.1.2. It seems like they either forgot or don’t know that the documentation is out of date.
I found the files under the following folders very useful to see the latest implementation:
Packages/High Definition RP/Runtime/Sky/GradientSky/
Packages/High Definition RP/Runtime/Sky/HDRISky/
Sounds like you got stuff working already, but for anyone else who needs examples:
For how to derive your class from SkySettings, see GradientSky and HDRISky scripts.
For deriving from SkyRenderer, see the GradientSkyRenderer and HDRISkyRenderer scripts.
For how to do your shader, see GradientSky and HDRISky shaders.
The shader code is especially different from the documentation page.
Hi @Korindian ,
Thanks for writing out some of that hard to find information for future visitors. Those two files were the ones that I checked too after going through the source files for too many hours. It should have been obvious to try find a Sky folder… Same goes for that thread @iamarugin linked. It’s not really easy to find.
One thing I that’s perplexing me is that we need to inherit from SkySettings when a custom sky is created? So, that brings all the stuff that’s in there (skyIntensityMode, upperHemisphereLuxValue etc.) and I really wouldn’t want those visible in the Inspector UI. I was just trying to get them somehow hidden/override them but no luck yet.
Some updates:
For my editor script I cannibalized majority of editor stuff from SkySettingsEditor.cs.
Added using UnityEditor to access the required editor things.
I inherited the class from VolumeComponentEditor instead of SkySettingsEditor to remove a few errors.
And I added access to my custom variables in OnEnable using that Unpack and added PropertyFields etc. to the OnInspectorGUI.
So now my values show up in Inspector, unneeded things are hidden and everything updates ok in the shader, but It’s hard to verify if that Update Mode is actually functioning but I don’t care at the moment as the custom sky looks ok, it’s enough for this learning experience.
But I’d like to have clear guidelines for this, it’s not good to hack some stuff that might or might not work ok.
With HDRP 7.1.5, some of the skybox classes and methods have changed. Again, we’ll need to see the built-in HDRP scripts from post #4 above and compare to see what’s different. It took about 5 min. to get it compatible again, so nothing major.
@Korindian hey thanks for the heads up, I just upgraded to 2019.3.0b12 yesterday and fixed this sky issue a moment ago. How those custom parameters are passed to the SkyRenderer looks a bit weird to my eye… But I guess I should just look more into the code etc.
@SebLagarde
Hey, I was just looking at that, that’s great, it’s a bit cleaner and makes a bit more sense, but I can’t find any good documentation about the parameters. I’ve been trying to add an Object Parameter (ObjectParameter), and none of the configurations I’ve tried have worked. Can I get some elaboration on that one?