2008-11-15

I hate GM, I love Blender

So I hate GM again.

Usually doesn't take long. ;P


However, now I have developed a much more robust triangle stripping algorithm that directly translates into huge vertex/VA savings in rendering. This is a really good thing, as instancing a model requires copying the base meshes's vertex VA, which means each instance takes a good chunk of memory (for a 1300 vertex red dragon, that translates to ~1800 vertices for strips, or 3900 for raw triangles. So, each instance requires 4*3*1300 bytes, which is about 16 kB, lol)

Either way, now it's onto making good things like a Memory Manager so I can dump ram as I see fit, and do tracked allocations and all that low level shit that I shouldn't have to do again. Also, I now have to use VBO's (if you card supports them) to do the rendering, and this is a very interesting thing:

VERTEX ARRAYS ARE SLOWER THAN IMMEDIATE MODE

Why, you ask? Draw a picture for yourself. Immediate mode is a 1 direction pipeline. The GPU pipeline just gets pushed data. The end. Vertex Arrays require synchronization of the GPU and system memory, which is about like trying to unflush a toiet. My FPS drops from ~230 to near 20 with immediate mode versus VA's. With VBO's, I can get into the 780 FPS range.

Therefore, use VBO's. Make sure your array data is SEPARATE (do not stride) so you can easily plug in instance VA data.

More testing is required, but here is a toolchain picture that makes me happy:


Note that this is a goofy looking stupid lizard monster. Also, note that it has collision boxes (defined each by two verticies inside the keyframe). Also note, that that collision information is exported correctly into SDL. Does this look anything like Mortal Kombat or Mugen to you? Exactly. The problem is, this lizard has bones. And, I had to write MORE scripts to convert it's animations into mesh keyframes. And MORE scripts to read and export the animation file that defines the animations, as well as game information like attack boxes and physics and so forth.

However, it's really nice to be able to quickly make something, and see it work in the game. No doubting that at all.

Until next update.

-Z

1 comment:

Peoria Home Theater said...

Appreciate you bloggging this