Monthly Archive for November, 2008

OpenGTA2 new rendering

OpenGTA2 new rendering engine doesn’t really work yet… But there is still a lot to do! Right now I finished most of important engine internals, and to have rendering I still need to add shader manager, finish texture manager/loader, and stuff like that.

Vertex buffer array works as expected (it renders via VBO), so does map caching and a lot of other stuff (even though map caching interface needs some rewrite/fixup).

Right now it outputs something like this:

P.S.:Next week will be classics week, I’ll repost some of good posts from my old blog! It’ll be fun!

Old Demod’s

Here are screenshots of some of older versions of my music player:

27.08.05 – DEMOD

01.05.06 – Demod (codename Demod I)

21.11.07 – Demod 2 (codename Demod II)

Last one is one I’m using up till today, although it’s getting old. This brings up question of starting developement of Demod 3. One of main Demod 3 features should be independancy of platform and sound library – in fact, it should provide own sound mixing where possible, possibly overlaying on top of decoding from other sound libraries.

It will have updated look, and have even more efficient GUI, plus a lot of built-in features, at same time focus will be made on memory usage. I plan to use C, kind of like for OpenGTA2.

Main target platform is, suddenly, WireOS.

Old shader I made

This is a simple fur shader I made long time ago based on some fur demo. It’s a very GPU-cheap way of rendering – fur is rendered in layers, each layer has texture that consists out of a lot of dots.

Now, vertex shader can be used to scale the initial shape by normals, each with this texture. If you also add texture map to move the fur, you can attach dynamics to it!

I lost the original files, but I’ll try to find them ASAP.

Texture atlases again!

Today I moved texture atlas generation to sty2tex utility (which converts GTA2 style file into OpenGTA2 texture file), and added sorting. This improved texture atlas a lot – you can clearly see on the pictures below!

This also increased overall size of texture file (was 24MB, now 30MB uncompressed, was 3MB, now 4MB compressed), but the speed gain should compensate for this.

Version with sprite edges marked:

Version without sprite edges marked:

Failed texture atlas

I forgot to post this yesterday, but here’s interesting result I got before texture atlases started working:

Also on texture atlases: OpenGTA2 will generate texture atlas for *.tex (texture & sprite data) files it finds, and re-save them. This makes creation of textures & sprites easy for other applications (no need to worry about putting sprites in texture atlas etc).

This will take a long time of course! So prepare that first loading time will be lengthy (or I might make external tool that generates texture atlas for free… or put it directly in texture conversion utils. I’m not yet sure!)

Texture atlass

Today I implemented very basic texture atlass for OpenGTA2. You can see the result above.

Texture atlass is a thing when you put (for example) 3000 OpenGTA2 sprites on a single texture, and use only one texture when rendering. Not more, not less – just one texture. That’s huge improvement on FPS!

Tomorrow I’m gonna optimize it, so it sorts by object size, and also put it in STY2TEX tool rather than game itself, because game initialization log looks like this: http://pastey.net/102691

OpenGTA2 runs on Linux


(Ignore the segfault – there were no maps, and there’s no check for that case yet)

It works on Linux without single code change (few misc fixes because some classes changed names). And I’m pretty happy that there’s no “#ifdef _WIN32 #else #endif” anywhere, except for single file that controls platform-specific extension functions.

That should be pretty much it. You also need some headers for windows version, but I’ll give link to all of them.

Today I partially implemented vertex buffer, which is a storage for vertexes and texture coordinates to be fed into GPU later (via Vertex Buffer Objects), plus a bunch more helpful things.

AROS