The SkyBox

How to put a sky in your game world and texturing models in Blender

I won't get this tutorial written tonight, but I wanted to get started. I also wanted to get the project code out there, if anyone wants to download it. It's actually self documenting because its so extensively commented. Game components were covered in the final part of the Holodeck tutorial if you need to learn about how to setup a game component.

I'm planning on expanding this tutorial later this week. First, I want to write a tutorial on how I created the asteroid models in Blender and got them into XNA. They are textured, which we have not really covered before and it seemed like the perfect opportunity to teach how to do textured models including how to create the textures used with them. Then I'll put together some sort of tutorial explaining this program; its already pretty much explained in the source code comments, but I want to do an actual tutorial like I did in the Second tutorial.

The ship model I got off the Internet. The info on that is in the source code. I also used a program to create the skybox textures and the info on downloading that program is in the comments of the source code as well. It's a cool program for making skybox textures.

This tutorial is supposed to be about skyboxes. So until I actually write this tutorial right, I'll just say this: One of the most common techniques for creating a "sky" in a video game is the skybox. It's just a textured box that follows the camera everywhere the camera goes. Tutorial One (the Holodeck) actually covered most of what you need to know to make a skybox, but I didn't mention that it was a skybox of sorts because I wanted to save that for now. In the Holodeck tutorial, the whole room was essentially a textured cube, which is all a skybox is. The primary difference is how it is UV mapped and the fact that a skybox follows the camera. In this example, I make the skybox procedurally instead of with a model. In fact, it is a game component that you can reuse to put skyboxes in all of your games. (You have permission to use it for whatever in anyway you want to use this code.)

Source Code

Concepts

Some of the concepts that you’ll learn from this tutorial are:

Part One - Textured Models

Part Two - Using a SkyBox

 

Files

Complete Project for Visual C# 2010 Express edition as a Compressed Zip file

 

 







Summary...

SkyBoxes in Space

I've decided to skip the Third tutorial for the moment and go ahead and get to work on the Fourth. It's more interesting and the Third is really kind of a continuation of the Second in a way.

In this tutorial we learn about skyboxes. We will also learn quite a bit about a few other things such as putting to use our chase camera from the Second tutorial and creating textured models in Blender that can be imported into your XNA game (the asteroids). Really, this is largely about putting together what we already have learned in previous tutorials.

Source Code

 





Tutorials

The Holodeck

Subsites

Blog

Files


Future Use