3D Programming: Eighth Chapter gleaming the Cube

Source: Internet
Author: User

This chapter introduces the classification of graphics-related topics, mainly including Skybox rendering,environment mapping,fog, and color blending (sky rendering, background texture mapping, fog, color mixing). The first two effects have one thing in common: they are all achieved through texture cubes. Learning this knowledge will allow you to go further on the road to graphics.

Texture Cubes

A texture cube (also known as cube map) is a collection of 6 2D textures. Each texture corresponds to the side of a cube centered on the origin of World Space and aligned to the axis. These textures can be stored separately in a file, or stored in a file in the same DDS format (3rd, "Tools of the Trade" discussed in DDS format). Figure 8.1 shows the texture cube in which all textures are stored in the same file, and each side of the corresponding cube is marked.

Figure 8.1 A Texture cube. Each of the face are labeled with the corresponding axis. (Texture by Emil Persson.)

Creating Texture Cubes

There are a variety of tools to create texture cubes. For example, Nvidia's DDS generic package contains a command-line tool, NVDXT, to create texture cubes (links are provided on the companion website of this book). NVDXT a series of individual textures as command-line arguments, compiling the textures into a texture cube and storing them as DDS-formatted files.

Microsoft provides DirectX Texture tool for creating DDS files, which are included in the standalone DirectX SDK installation package (not part of the Windows SDK). In Figure 8.2, a texture cube is loaded using DirectX Texture tool, and the cube Map face menu item is selected under the main menu. Use this menu recommendation to specify a side of the cube map to display.

Figure 8.2 The DirectX texture Tool. (Texture by Emil Persson.)

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.