Creating a Skybox
A skybox is a way of representing a 3D panorama that can be seen in every direction, no matter which way you turn your head. One of the most classic ways of rendering a skybox is to use a cube surrounding the viewer, with a detailed texture on each face of the cube; this is also known as a cube map. When we draw the skybox, we just need to make sure that it appears behind everything else in the scene.
When we use a skybox, we use a cube to represent the sky, so normally we’d expect the sky to look like a giant cube, with highly visible joints between each face. However, there’s a trick that makes the edges of the cube disappear: each face of the cube is a picture taken with a 90-degree field of view and a planar projection, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access