NOGDUS

Other => Independent Projects => Topic started by: Mattias Gustavsson on May 09, 2010, 01:25:16 PM



Title: Isometric Graphics Engine
Post by: Mattias Gustavsson on May 09, 2010, 01:25:16 PM
Recently, I've started to do some actual work on a project I've been thinking about for ages - an isometric 2D graphics engine. I have an actual game I want to make with the engine too, but I'm not ready to talk about that yet - but I thought I'd post a bit now an then about the engine :)

It is built on top of Pixie (of course), and I've been working on some rendering scripts for Poser (the art tool I use) which renders my objects in several different ways - so that I can use them to do some nice real-time lighting :)

Here's the result (and below it are the different images I render from Poser):

(http://www.colossusentertainment.com/forumref/iso_lighting1.png)
(http://www.colossusentertainment.com/forumref/iso_lighting2.png)

What I'm actually doing here, is rendering four images in Poser - one for the basic textures, or albedo, one for the facing direction (or normal) of each pixel, and two for shadows (one for the ambient shadows and one for the shadow of a fixed directional light source). These images are then stored in a much more compact format - albedo is palettized to 8 bits per pixel, the normals are stored with 8 bits for x, 7 bits for y and 1 bit for z (for a total of 16 bits) and the shadows are stored as 8 bits per pixel (though I'm considering dropping it to 4 bits per pixel, which might work ok). Each of these are then RLE-compressed, making for quite efficient storage.

When I'm rendering, I do a straight forward deferred renderer (but I do it in software - no GPU acceleration) where I render the four RLE datasets to four buffers, and then perform (linear space) lighting in a separate pass (for now, I do two full-screen directional lights and hemisphere ambient lighting, but I'll add support for point lights next), followed by a final pass of "filmic tonemapping" (yeah, I got that from this years GDC presentation on Uncharted 2 :P)

And I'm quite happy with the result so far - can't wait to see it with point light sources :) There's still a lot of optimization needed, but for now, I'd be really happy if you guys could try it out on your computer, and let me know what your system spec is and what frame rate you're getting. Runs on Windows and Wine.

Download lighting demo (http://www.colossusentertainment.com/forumref/iso_lighting.zip)

(I won't be able to have dynamic shadows with this technology, and I guess it does look a bit funny when the light sources move and the shadows don't, but I think I can live with that...)

Many thanks,
Mattias


Title: Re: Isometric Graphics Engine
Post by: Richard Marks on May 09, 2010, 07:54:21 PM
Fantastic! Someone besides me is actually posting something! ;D

Great work Mattias! I'm interested in hearing more about the method you used to pack those texture maps. I.e. (How did you break them into the bit packs that you did?)

I got 59 FPS in full screen, and 58 FPS in windowed mode.
Specs:

Windows Vista Home Premium 64 Bit with SP1
DirectX 10
4GB RAM
Intel Core2 Duo 3.0Ghz/core
512MB nVidia GeForce 8600M GS driver version 7.15.11.7713



Title: Re: Isometric Graphics Engine
Post by: Mattias Gustavsson on May 10, 2010, 06:49:49 AM
Thanks Richard, that's great :-)

As for the packing, well, it's basically the standard Pixie RLE compression, which is done in the file GenerateRLE8.cpp (http://pixieuniversity.com/pixiedocs/_generate_r_l_e8_8cpp_source.php).

But remember, I do all this on the CPU, so I can store my data in any format I like, rather than having to use whatever texture formats are supported by hardware :-)


Title: Re: Isometric Graphics Engine
Post by: Mattias Gustavsson on July 22, 2010, 04:07:18 PM
I'm getting this project moving again, progress can be followed on here: www.rivtind.com