-
Notifications
You must be signed in to change notification settings - Fork 0
/
NightAndDay1Comments.txt
15 lines (8 loc) · 2.25 KB
/
NightAndDay1Comments.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
NightAndDay1
This script controles the sky and sound in order to mimic the setting and rising of the sun, rotation of the heavenly spheres, and day and night ambient sounds.
SCENE REQUIREMENTS: This script requires that the game has 4 DIRECTIONAL LIGHTS, 1 PARTICLE SYSTEM, 1 SKYBOX, and 3 AUDIO SOURCES.
The directional light for the sun should be far away from the play area (e.g., position [0,500,0]). For best effect, the sky should be default, or a skybox with an equivalently dynamic sun. This sun directional light should be set as the sun for the skybox (this can be done in the Lighting settings for the scene). The directional light for the moon should be placed at a downward angle towards the scene, with a blue tent. The two other directional lights ('front light' and 'back light') should be place at downward angles towards the scene on opposite corners of the scene. These lights will be extra sunlight and thus should be the same color as the sun.
For best effect, the stars particle system should be a sphere shape with a radius of 800 with "Emit From Shell" checked. Its "Rate Over Time" should be set to 5000 and its "Max Particles" should be 0, or at least a small number. For variation, I recommend setting the "Start Color' to a random color between white and a light blue, setting the "Start Size" to between 5 and 14, and setting the "Start Lifetime" to between 360 and 1000 seconds. If you desire smaller and/or more numerous stars, increase the radius of the particle system and number of particles generated by the modifyStarNum function. However, if the particle system radius is increased, the camera's clipping plane Far variable will also need to be increased so it can see the stars.
There are no requirements for the audio sources, other than they should all be set to "Loop." For best effect, set birdChirp1 and birdChirp2 to two different unobtrusive bird sounds. Also, set nightAmbience to quiet night sounds such as wind or crickets.
TO MAKE THIS SCRIPT FUNCTION PROPERLY, PLACE IT ON THE SUN DIRECTIONAL LIGHT IN YOUR SCENE. However, this can be easily modified in the code, if desired. Also, set the Sky Speed variable (in the script's component) to 5 and then adjust it until you have the desired speed.
Chris Kawell (8/15/2017)