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

Get OpenGL ES 2 for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.