1. A day in the valley ​
Status
Written from the editor's fields and the reference pages. Not yet checked step by step in the editor.
In this tutorial you give a world a warm morning and a mist in its low ground, and you learn what the three light configs (Sun, Sky, Environment) are each for.
Time: about 15 minutes.
Before you start: you need a world with some ground, as in the template project.
Part 1: look at the world as the game shows it ​
A world scene has no sun, sky or environment of its own, so the 3D viewport shows Godot's plain light. The Environment Debugger shows what the game shows.
- Open the scene of your world (World > Worlds, select it, Open Scene).
- In the 3D toolbar click Environment. A bar opens at the top of the viewport and the viewport now has the sun, the sky and the fog of the game.
- Drag the Time slider. The sun crosses the sky, the colours of the sky and the light follow. Click Play and set the speed to
1to let a day go by.
Part 2: the path of the sun ​
- Click World Configs in the bar and open the Sun tab. Click Create New and name it
Valley sun. - Change Sun heading from
90to180and look at the viewport: the sun now runs north to south. Change Sun rise hour to7. Put the heading back to90.
The Sun config is only the path: where the sun is and when. A world has one. How the sun looks is the Environment's.
Part 3: a warm morning and a mist ​
- Open the Environment tab, click Create New and name it
Valley mood. - In Sun Light set Sun max energy to
1.6. In Sun Light Colors make Sun dawn color a deep orange and Sun day color a warm cream. Drag the time slider to sunrise: the light is orange and the shadows are long. - In Fog Settings set Fog density to
0.003and the Fog light color to a pale blue-grey. Leave Fog sky affect at0.2so the sky stays visible. - Under Fog Height type the height of the valley floor plus a few metres (if the floor is at
0, use6) and set Fog height density to0.05. The ground fills with mist and the hills stay clear. Everything under that height is misty, at any distance.
Each change shows in the viewport as you make it.
Part 4: use it ​
- In the bar choose
Valley sunin Sun andValley moodin Env, then click Use for this world. The world is saved with them. - Click Test World and walk around: the morning is warm and the mist lies in the valley.
Going further ​
| You want | Do this |
|---|---|
| A fog that changes colour with the day | In By the Hour of the Environment give Fog color by hour a gradient (dark blue at night, warm at dusk): the Debugger's time slider moves it |
| A sun that does not move | In the Sun config untick Day night cycle and set Static rotation. Its brightness is the Static Sun Light group of the Environment |
| Another place with another mood | Make a second Environment (a swamp, a cave) and give it to that world, or to a zone when zones can have one |