Game programming Learning (skybox)

Source: Internet
Author: User

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 ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.