Top

Building an XNA Skybox with Blender

March 30, 2008

033008skyboxtitle.jpgWhile you’ll find a lot of skydome tutorials on the net, sometimes you just want a simple skybox. Here’s how to build one in a few minutes in Blender.

In order to build your skybox, you’re going to need to know the basics of UV texturing and exporting in Blender. If you aren’t up to speed, check out part one and part two of my XNA/Blender series.

Once you’ve got that nailed, all we really need to do is make sure our cube has it’s normals flipped. If you try to render a typical mesh with the camera inside the mesh, you won’t see anything. Why? Because the normal vectors of the faces of the mesh are pointing outward. That means, as far as the rendering engine is concerned, you aren’t looking at anything — least of all the textures you’ve applied to your cube.

So the first thing you need to do is enter Edit Mode in Blender. Look at the buttons window. We first want to display our normals so we can be sure they are pointing the right way. Select all and click the Draw Normals button under Mesh Tools 1. You should now see a short blue line sticking out from each face of your mesh. These are our normals, and they are pointing outward.

Now click the Flip Normals button under Mesh Tools. The normals disappeared! Actually, they didn’t. They’re just pointing inwards now.

Now texture. A few things to note:

  1. It’s probably a good idea to do a lot of zooming, grabbing and rotating while in UV/Image Edit to make sure you don’t have any visible seams.
  2. Although using the smallest texture possible is generally a good idea, this is one place where you should use the largest texture you can. Skyboxes are pretty important, since their pixels will occupy the vast majority of the display, and what makes matters worse is that each face is only at most 1/6th of your texture. Unless you individually cut out each face, it will be much much worse than that. Go big here!
  3. When you try to load and draw your skybox, make sure your camera is inside the box! You may get some clipping if the camera is near a face of the cube.

Let’s see what it looks like:

Comments

2 Responses to “Building an XNA Skybox with Blender”

  1. GameDevKicks.com on March 31st, 2008 10:01 am

    Building an XNA Skybox with Blender…

    You’ve been kicked (a good thing) - Trackback from GameDevKicks.com…

  2. ragnarsun on August 26th, 2008 4:10 pm

    In blender 2.47 the “Draw Normals” is in panel called “Mesh Tools More”.

    Great tutorial ;)

Got something to say?





Bottom