I’m trying to make a day night cycle for a 3d game. I made the sun moving, but now I want a smooth transition between day skybox and night.
Day skybox has cubemap and the night skybox is 6 sided
I tried this:
if(hour > 12){//midnight
RenderSettings.skybox.Lerp(RenderSettings.skybox, night, 0.5f / Time.deltaTime);
}else{
RenderSettings.skybox.Lerp(RenderSettings.skybox, day, 0.5f / Time.deltaTime);
}
After 12, the sky is totally back(I mean it lerps only the color, not the skybox textures):
Day:
Night:
Lerp: