How to achieve different day times and weather conditions in HDRP? Like, what settings and parameters should I tweak? Or if I want some rainy weather with nice looking clouds it’s better to look for some assets in the Asset Store?
For performance reasons, HDRP don’t currently support realtime “time of day”.
However, you can still use a Physically Based Sky with a Directional Light that moves to simulate the sun/moon position (sunset, high noon, sunrise… etc). The PBR Sky will update its color and sun disk according to your Directional Light orientation.
For clouds, currently on latest HDRP you can use the “Cloud Layer” override which is a simple cloud layer to simulate the upper layer of clouds that can be setup in the “Visual Environment” override. It can be added on top of any Sky.
Also, it’s not fully ready yet, but in the near future you will be able to combine it with the “Volumetric Clouds” override for closer, interactable clouds (that receives fog and volumetric light).
thank you so much for the information!
Hi, could not see the Cloud Layer in the Sky Override in HDRP 10.3.1.
Hi, it has been removed temporarily in 10.3 but it’s available starting from HDRP 12 which is available in the latest 2021.2 alpha for now. It will most probably be backported to HDRP 11 (2021.1.x) soon !
Thx for the info. Looking forward to test it.
HDRP 11 is out now with Unity 2021.1. How are things standing with the ‘Cloud Layer’? Are there plans to get in Unity 2021.1 using HDRP 11?
AFAIK, no plans to backport it to 11. You’ll need HDRP 12 available in latest 2021.2 alphas.
Wait how did we have to handle the Sun and Moon lighting transition with this setup? using 2 directional light and flip them at dusk/dawn or just one directional light?
Day night cycle makes the game lighting amazing especially for outdoor scenes…
this is my experience …
managing sun, moon and sky rotation and color using procedural and calculation way has too much high quality result
this is a simple calculation of the day night cycle :
I worked on it to customize based on my needs and the result was amazing:
I did some tests on a personal project and the physically based sky can already handle two directional light and celestial bodies. But you still have to disable one or the other when it is under the horizon, else it will still affect the objects in the scene.
The other tricky thing is to switch shadow emission from one to the other, because HDRP supports only a single directional light casting shadows. This can be done through the API .
Oh this is the setup that i currently used. The only missing part is handling the sky and fog volume settings depending on TOD
The planet itself blocks the light if its below the horizon.
I keep both the sun and moon active all the time and objects don’t get lit if they are in the planets shadow.
you can keep both light active, but you can’t have both light have shadow enabled, this is the only thing that you need to flip or else HDRP will freak out because the shadow atlas can only support one directional light
This tutorial worked fine for me in HDRP, certain values will need to be tweaked like light intensities, and space emission multiplier, the shadow emissions get switched as well.
interesting, in my HDRP version updating the sky at runtime tanking the FPS.
Any idea why updating HDProbe.RequestRenderNextUpdate() is causing a dark flash for me while updating? Its very quick and looks like the reflections are going dark while figuring out what the next should be.
Is there a different way I should be handling time of day? Its an overhead style game.
I followed this tutorial; very useful.
However, for me setting the Space Emission Multiplier to such a high value has a major effect on the scene, as it affects the amount of light the space background emits. I had to keep the value under at/under 1 to avoid issues, whereas in the video he uses a max value of 1000.
Perhaps Unity has adjusted things to make the old 1000 value unusable, or perhaps I missed something or am doing something wrong.
With that said, this seems like a bad way to control how visible the night sky is. Is there a way to make it based on how much non space light is hitting the camera?
This tutorial is a good way to kill performance, moving sun each frame is very expensive, setting up specific steps per frame much more convincing.
As for emission, it’s better to keep it within static number (I use around 15, depending on texture you are using)
Interesting. In my test (Editor only, Unity 2023.2.0b12, HDRP 16.0.3) I only see a 1-2 FPS drop when moving the sun. Of course, there are likely certain settings/features that do not handle the movement as well. Is there something you know of for sure that doesn’t like the sun being moved?