Projects

A quick look at some game related programming projects I have done.

3DS Max Exporter and DirectX Character Animations

I wrote an exporter for 3DS Max that exports it to my own file type. To test that it was working, I had to add character animating to my DirectX engine (aka skinning). Unfortunately, the actual exporting process is rather dull to look at, so I’ve instead posted a video showing the finished product of the character animation. Skinning is a pretty interesting process. Each vertex is affected by up to four bones, and is assigned a weight by how much they are affected by each of those bones. In a character animation shader, the vertex needs to move relative to its attached bone. This is accomplished by moving the vertex into world space, then using an inverse bone matrix to get the vertex in bone space, and finally multiplying by the bone matrix at a specific time t, to get where the vertex should be. After determining a vertex relative to a bone, you multiply that position times the weight of the vertex to that bone. Finally, add up all the positions, and you have skinning! It’s pretty cool to find as much complexity as there is in something so easy to take for granted.

This model was provided by my Professor Jani Kajala.

Shadow mapping

Shadow mapping some (open source) plane models in DirectX 10. To set up a shadow map, you first render the scene from the light source, gathering all the depth value. Then render the scene normally. When rendering a particular pixel, get the distance from that pixel to the light source. Then move the pixel into the light sources screen space. If the distance is greater than the distance registered in the light sources depth pass, this pixel should be shaded

Bump and Parallax mapping

Using DirectX 10 shaders with a bump map and a depth map. The object is just a cube with each side made of 2 pixels. Any depth or pop out you see is just tricks done in the shader. I use the bump map to light the pixels so they appear 3D (despite it being a flat surface). The depth map is used to stretch the texture away from the camera. This is called “Parallax Mapping” and makes things appear to pop out of flat surfaces.

Landscape Rendering

This is a landscape renderer I built in DirectX 10. It takes in large heightmap files and a texture, and then builds all the vertices at run-time for display. This example uses heightmap data from Hawaii. Normals are computed for every point while loading and can then be used for stuff like lighting. Level of detail is determined dynamically, so areas that are close to you will be rendered in high detail with lots of polys while areas farther away are rendered with fewer polys. Stitching is implemented so that if two areas of different levels are detail are next to each other, they won’t form a hole at their intersection point. With stitching, you’re guaranteed no nasty weird looking holes while doing dynamic level of detail. There is also frustum culling so only things that are looked at are being rendered.

Cooperative Pathfinding

An implementation of an algorithm intended to simulate agents moving towards their destinations with knowledge of other friendly agents. Their path is built around the paths of other agents. These guys pretty much all move between two set points that will lead them into a conflicting path (where they would normally bump into each other). If all goes as plans, however, when they’re figuring out their path using A*, they will do so with knowledge of where their friends will be at a given time, so that their plans won’t lead them to bumping into each other. At around 20 seconds, you can see me move a unit into a tight corridor, and then ask another unit to move through that corridor. The cool thing about this algorithm is that it appears the unit will walk right up to his friend, ask him to move out of the way, and then continue to his destination. It’s not a perfect algorithm (there are a few cases of guys bumping into each other), but those instances can be handled gracefully while still maintaining the appearance of intelligence on the part of the agents. Source article.