Archive for June, 2009

Shader programming is fun!

I missed shader programming when it was new.  My first foray into 3d graphics was before 3D cards, and by the time the first programmable pipeline graphics cards became available, I was in the corporate software world writing, well, uninteresting non-gaming applications. Recently I’ve been re-writing Operation: Star Hammer to use 3D models, which as presented a lot of opportunities for some eye candy, and an opportunity to get my teeth into shader coding!

Something that 2D can’t do that 3D can is directional lights. I’ve added an effect to the game when the player fires their lasers that lights there ship, like a muzzle flash. Cool. But the shader effect I’m most pleased with to date is the afterburner effect, not necessarily from a visual standpoint, but from the power of using GPUs to do the work.

Players can get a temporary speed boost that uses energy. An afterburner flame is shown at the back of the players ship. To make this effect, I used a gas hotplate as inspiration. I grabbed a photo of my kitchen hotplates in action – domestic appliance and game development DO mix – to serve as a way to pick good colors and shape. The flame is model as a single mesh. The animation is done in the shader.

afterburner

Something I noticed was that the real-world flame is mostly transparent in the centre, and almost opaque around the edges. So, in the pixel shader, I calculate the opacity based on the flame models normals.

flames

Flames also flickers, which means only one thing…vertex animation. The vertex shader deforms the vertices of the model in interesting ways, giving a pretty decent illusion of flicker. Finally, I’m also animating the UV coordinates so that the texture appears to slide along the flame as well.

So, by combining a static model, and a static texture with a shader that does vertex animation, UV animation and some interesting alpha calculations, I’ve got an afterburner flame I’m pretty happy with.

Lessons learned : Use real-life objects to understand how things can/should look, GPU’s are awesomely useful, and it’s really fun to get the GPU to do all of the work.

, , ,

1 Comment

Building an art pipeline, Part 1

A while ago, I posted about wanting to make Operation: Star Hammer more 3D. By modern game standards, the 3D art requirements for O: SH are quite small. It’s mostly ships, aliens, weapons, etc, and that’s just fine, because that’s the game I want to make. As a programmer by trade, I don’t have 3D tools at my disposal, and for that matter, haven’t really spent a lot of time using them. Until now.

I needed to get some tools to allow me to develop 3D art – and there are dozen of them! Like choosing a programming language, there are several tools for ever job – and a wide variety of prices ranges, from free to thousands of dollars.

In the games industry, the most common packages are 3DS Max and Maya. Whilst I considered getting one of these, I decided that I probably don’t need the functionality they provide, so much of the money spent would be wasted. I don’t need a renderer, or character animation. The most important things are being able to create a good low-poly model, and then texture it.

Some of the packages I evaluated to get down to a short list to build the pipeline : Modo, Zbrush, Mudbox, Maya, Cinema4D, Blacksmith 3D, Headus UVLayout, Lith Unwrap, XSI Mod Tool, Wings 3D (and maybe some others). Note two absences from the list : 3DS Max, and Blender. In the case of Max, it’s way too pricing for my needs. Most of it’s features would be wasted. I’ve tried to learn to use Blender in the past several times – and failed. I have to wonder how many people decide to learn 3D art, find Blender is free and download it, only to be put off 3D all together. I’ve heard that Blender is good once you get know it, but I prefer software to be, well, accessible, easy-to-learn and intuitive.

Anyway, my needs for this project are simple : modelling, UV unwrapping and texturing. And I wanted ease-of-use (who can be bothered with difficult to use software?). In the end, I’ve chosen to go with Silo3D for modelling, and 3D Coat for texturing.

Silo3D is a great sub-division modeller – nothing more, nothing less. The strength of Silo is that it doesn’t try to be all things to all people, it’s focused on making 3d models, and nothing else. Its UI is clean and free of clutter, and I like the camera controls. One downside in the first few days I used it was an occasional crash, but as I’ve learnt to use the package the crashes have stopped, so I suspect the problem was just as much me making malformed horrid models as anything else. Still, a little more robustness would be nice. There are also plenty of video tutorials that help new users get the hang of using the program (and teach modelling skills as the same time), and a helpful community.

3D Coat is a model painting program. It paints color, specular and displacement maps at the same time. Forget about using a 2D program like Gimp or Photoshop to color your texture map. As with the likes of  Zbrush, Bodypaint and Mudbox, 3D Coat allows modeling painting in 3D directly onto the model. The good thing about 3D Coat is that it’s about 20% of the cost of the other similar packages. 3D Coats UV unwrapping tools seem pretty cool so far too. If I decide to use bump or normal mapping in O: SH, I’ll be able to paint them directly onto the model. Cool!

, , , ,

2 Comments

Subversive Games

I realised that I haven’t posted for a while, so thought I’d catch up. Part of the reason is because I’ve been working with Subversive Games for the last couple of months. I can’t discuss the project (so I won’t :) ), but obviously it’s a gaming project. Subversive Games make “serious” games for businesses, rather than “consumers”. The games Subversive makes are intended to be entertaining, whilst at the same time providing training, or promoting a brand or product.

I think the idea of using gaming technology to train people to do there jobs is awesome. I mean, given a choice between sitting in a classroom being talked at about the theory of how something works, versus interacting with a simulation, I know what I’d prefer!

As the entertainment focussed game market gets more crowded and competitive, I expect more game developers to look to training games as a way to survive and grow.

No Comments