Blender Graphics in "XCurse"

Sprites

Our sprites are image textures mapped onto a quad (four-sided polygon, actually two triangles). To comply with a limitation of older graphics cards we use quadratic power-of-two textures (128x128, 256x256 etc.)

Alpha

All sprites have an alpha channel to make alpha blending possible which is needed for transparent effects and anti-aliasing. To create an alpha channel in Blender you choose "RGBA" in the Scene Context and save in a file type that has an alpha channel. I use PNG because it is easy to handle in DirectX 9 and creates smaller files than TGA.

The options "Sky", "Premul" and "Key" are also very important when using alpha. "Sky" blends the color values with the background color depending on alpha. "Premul" pre-multiplies colors directly with the alpha values, whereas "Key" just stores colors and alpha separately. The following figures show the difference for a green background.

Sky Premul Key

"Key" is the best in our case because the standard alpha blending math in DirectX needs non-multiplied color values.

Camera and Lighting

To avoid perspective distortion which would look odd in a game based on sprites and tiles I use an orthogonal camera. For consistency the same light setup is applied to all objects. It creates a basic lighting even when no dynamic lighting is effective.

Texture Mapping

Lots of the sprites in our game have procedural textures, e.g. the asteroids, but other sprites use image textures intensively: color maps, alpha maps, bump maps. We have several sprites of highly detailed space ship wrecks. But in Blender they are made of very simple shapes. The details come from texture mapping.

Texture Mapping

Displacement Mapping

A big step in Blenders development was the introduction of displacement mapping. It is a type of texture mapping that actually moves the vertices of an object's surface at render time. Among other things it is very practical for the creation of irregular natural surfaces. I use it e.g. for asteroids.

Ring Asteroid Ring

If you want to use displacement mapping be sure you set the "Sub Surf" level in the Edit Context high enough.

The "Env" Option

A very helpful feature in Blender is the "Env" option on the "Mirror Transp" panel in the Material Context. It lets the background shine through at places where the object with that material is, no matter if there are other objects behind. Since I render with alpha enabled, the sprites are transparent in those areas.

I use this especially for the weaponry of the space ship. So we need only one sprite for the hull while the currently active weapon is drawn over it. With "Env" this works even if parts of the weapon are covered by the space ship because I can render the weapon with these parts cut out. It is a bit difficult to explain, so please have a look at the following figures. The first row shows the rendered weapon, the second row shows the composited image. Please note that the outline of the ship is just for illustration. It is not part of the actual rendering.

Env Demo

Particle System

For the explosions I use Blender's particle system. I'm experimenting a lot to create impressive and good looking explosions that match the style of the game. It is a trial-and-error process and therefore takes quite some time.

Explosion

Animated Sprites

The game has lots of animated sprites. At the moment I do mainly key-frame animation. The final frames are packed into a square texture for optimal use of texture space. Therefore animated sprites usually have 5x5=25, 4x4=16 or 3x3=9 frames like the following copper coin.

Copper Coin

Go to Normal Maps