I am making an open-world project in Unity 4.5.5 and I want to create a visual effect of transitioning from day to night? The Legend of Zelda: Wind Waker HD has a great example of such a transition.

How can I achieve this? Can I use a script or do I need to create multiple scenes with different skyboxes to make this possible?


First off, use this shader for your skybox: http://wiki.unity3d.com/index.php?title=SkyboxBlended

The default Skybox shader won't allow you to transition between two skyboxes (eg. one for day, one for night). The "blended" value of this shader can be adjusted in code, so adjust it over and over a little bit every frame.

Meanwhile, besides the skybox you also have to adjust the lighting. This depends on how your scene is illuminated; this could be as simple as gradually decreasing the intensity of your main directional light.

  • \$\begingroup\$ How do I adjust it over every frame and how will I have to adjust the lighting? Do I just rotate it? \$\endgroup\$ – kprovost7314 Oct 25 '14 at 22:19
  • \$\begingroup\$ I said what to do with the light: decrease the intensity. The code to set the blend value is on that page; put that inside the Update() function to run every frame. \$\endgroup\$ – jhocking Oct 25 '14 at 22:48

today I just crossed with the same need and I can point you towards some interesting resources.

Basically the technique implies: 1) blending various textures of your skybox over time: that implies writing a shader that blend in and out different versions of your skybox at different daytimes/exposures.

2) maybe you also want to blend different Lightmaps to maintain the world static illumination coherent

This is an asset that animate the skybox day cycle (the second link is a demo) http://u3d.as/content/o4karit-o/animated-day-night-skybox/5V2 http://sea-estate.ru/demo.html

This is a shader in the unify community that blends skyboxes: http://wiki.unity3d.com/index.php?title=SkyboxBlended

Another shader with smooth transition taken from an article: http://www.galawana.com/unity3d-advance-skybox-blending/

This is a package that allows you to animate and blend lightmaps. https://www.assetstore.unity3d.com/en/#!/content/5674

  • \$\begingroup\$ I only like the third link with the demo because I have already seen SkyboxBlended in the Unify community, and I don't want to pay to animate day and night transitions. \$\endgroup\$ – kprovost7314 Oct 24 '14 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.