Monday, January 16, 2006

Render Where?

That is the question.

Since we are developing a game for 3 separate consoles simultaneously it makes sense to try and write code that will work on all 3 in one go, if we can. In order to lighten the workload for us we use a "bought in" graphics engine called Renderware (hence the hilarious pun in the title). This has different versions for different consoles but at the top level looks very similar. Which is nice as one can write code which uses Renderware and it should, hopefully, fingers crossed, look pretty similar on consoles across the board.

Quite whether Renderware or Sony are to blame for the extreme state of stress i have experienced today is open to debate. I want to blame Sony for making the PS2 a nightmare to work with. However, i also want to blame Renderware for being thoroughly shady in some of its functionality. Perhaps i shall blame Sony and Renderware. Yes, i think that does well.

The problem arises when one attempts to examine the pixel data contained in a texture. For the uninitiated, in computer terms a texture is a collection of data (typically square, for our purposes) which when viewed on the screen is a picture. Within the texture is the colour data, organised, according to the texture format, into pixels. So, each block of memory which makes up a pixel can contain Red, Green, Blue and Alpha (transparency) information. Renderware gives us a "pointer" to the start of the texture, and reading can commence. However the playstation in particular doesn't store its data linearly, preferring to "swizzle" it in order to make it faster to access. This means essentially that certain values get swapped about, in a confusing manner. This is all well and good as Renderware is supposed to sort it out for the programmer, to make life easier and less error prone.

I am discovering that life is rarely less error prone.

The particular situation which i am dealing with (i won't go into massive depth, but it's a palettised texture if you are interested, and i want to write directly to the palette) is probably the point where the Renderware programmers got bored of making things sensible and decided to really shaft you.

Suffice to say that combined with the enormous compile times for the PS2, i am not the happiest of bunnies with Renderware at the moment.

1 Comments:

Blogger PimpernelP said...

Great blog Johannes!

Tis coming along a treat!

9:23 PM  

Post a Comment

<< Home