Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenGL Game Development By Example

You're reading from   OpenGL Game Development By Example Design and code your own 2D and 3D games efficiently using OpenGL and C++

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781783288199
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Robert Madsen Robert Madsen
Author Profile Icon Robert Madsen
Robert Madsen
Stephen Madsen Stephen Madsen
Author Profile Icon Stephen Madsen
Stephen Madsen
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

The skybox

While space may be infinite, your computer isn't so there has to be a boundary somewhere. This boundary is called the skybox.

Imagine that our spaceship is flying through space! Space is big. While we may put some planets and asteroids in our universe to give the space ship something to interact with, we certainly won't model every star. Here is what our universe looks like:

The skybox

This is pretty empty, right? You probably already noticed this in our game, SpaceRacer3D. Of course, we could add some more objects of our own—more asteroids, add a bunch of stars—and in a real game, we would. But, there is always a limit to how many objects you can add to the game before you start having performance issues.

For the really distant objects, such as distant stars, we fake it by using 2D textures. For example, our game could use a texture of stars to imitate the stars and nebula in space, as shown in the following image:

The skybox

Now, as a cube has six sides, what we really want is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime