Game Development Reference
In-Depth Information
Unity Specifics
Skyboxes
Unity comes with a number of skyboxes. To use these, you must
import the skybox package by selecting Asset > Import Package >
Skyboxes.
To apply a skybox to a scene, select the Main Camera and location of the
Camera component in the Inspector. Set the Clear Flags value to Skybox.
Select Edit > Render Settings from the main menu and, in the Inspector,
set the Skybox Material to the one you want. In the Game, the chosen
skybox will display.
To use your own skybox, create a folder on your computer containing each
of the skybox textures. Name the textures after the folder name and suffix
with their position. For example, if your folder were called sunset , then each
of the images would be sunset_up.jpg, sunset_down.jpg, sunset_front
.jpg, sunset_back.jpg, sunset_left.jpg, and sunset_right.jpg. Drag and drop
this folder into the Project. Your custom skybox will now be available
in the Render Settings.
7.5.2 Sky Domes
A sky dome, as the name suggests, is a dome mesh placed over the
environment with a sky texture stretched across the inside surface as
shown in Figure 7.34 .
The sky dome is attached to the player's camera, like an oversized helmet,
such that it moves everywhere with the player. Unlike a real helmet, it does
not rotate as the camera looks around—it just translates, ensuring that it is
always projecting a sky with the player at the center. This ensures that the
player never sees the edges of the dome. If the dome is not big enough, as
terrain and scenery come into view, they will pop through the dome edges.
Strategic sizing and positioning of the dome are critical to ensure that this
does not occur.
Because the UVs of the sky dome are inline in arcs across the sky mesh,
it's simple to scroll textures across the mesh in the same way the textures
are scrolled across a plane in Chapter Two. This makes it easy to add cloud
textures to the dome and move them across the sky.
In the next workshop, a sky dome package created by Unity Developer Martijn
Dekker 2 will be used to place a sky, complete with moving clouds and a sun,
around a first person controller. Dekker has taken into consideration Rayleigh
scattering and the Mie Theory to produce a truly exceptional sky dome.
2 Slightly modified by the author to suit the purposes of the workshop.
Search Nedrilad ::




Custom Search