Sky box
1. Categories of the sky
Currently, the "sky" technology is described in three types:
Flat sky plane)Put only one tablet on the top of the head.
Sky Dome)A curved surface is placed on the top of the head.
Sky box)In the scenario is a cube.
The sky box is often a cube composed of six faces and often moves with the moving of the viewpoint.
The sky box depicts scenes that are far beyond reach.
2. Implementation of the sky box
Unlike the common cube implemented by d3d, in most cases, our point of view is inclusive in the sky box. Therefore, the vertex sequence of the sky box should be exactly the opposite of that of the common cube.
In the simplest sky box, you only need to fill in 24 vertices of six faces, and then paste the texture on each face.
3. Miscellaneous
Skybox is not a difficult task for programmers, but to make the sky look "nice" in the program, it also requires the participation of artists.
The sky is relatively expressive. World of Warcraft adopts this method.
For scenarios that do not pay too much attention to the vision, it is also a way to use skyboards. In this case, the solid fog will cover the entire vision, so that the distance is full of mysteries.
In some advanced applications, the texture of the sky box may be used to generate a cube map at the same time, and use it to produce dazzling effects such as water reflection, cloud shadows, and reflection.
Sky box source code: Contains DirectX and OpenGL implementation (Address: http://download.csdn.net/source/943187 ).