1
\$\begingroup\$

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?

\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ How do I adjust it over every frame and how will I have to adjust the lighting? Do I just rotate it? \$\endgroup\$ Oct 25, 2014 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, 2014 at 22:48
0
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\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\$ Oct 24, 2014 at 22:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .