Page 22 of 22

Re: Progress Thread - New demo - Cobra Mk III (18-May-08)

Posted: Sat 16 May, 2009 12:45 pm
by qarnos
benryves wrote:Wow, nice to see you're getting back into the project.
Well, I'm trying to! It's amazing how much code rots when you leave it for a while. I need to have a good clean out tomorrow and sort out what's good and what's junk :P

Re: Progress Thread - New demo - Cobra Mk III (18-May-08)

Posted: Sat 06 Jun, 2009 10:29 am
by qarnos
I've been doing some work on a 2D OpenGL-style graphics engine, and decided to take a crack at doing some texture mapping (mainly for rotatable sprites).

I thought I'd post it in this thread, since it is slightly related to 3D, but probably too slow to use in Aether.

Image

The texture in the demo is 32x32 pixels. The mapper supports tiling (though it is buggy at the moment) and I hope to implement masking.

It comes at a cost though - each texture you want to use requires generating a 512-byte lookup table. If it weren't for that, it would be horrendously slow.

There is lots of 16x16 bit multiplication involved, which accounts for much of the slowness. The inner loop in the mapper also takes around 200 T-States to fetch each texel - which adds up very quickly if your texture occupies a large area of the screen. Smaller images are reasonably quick though.

Re: Progress Thread - New demo - Cobra Mk III (18-May-08)

Posted: Sat 06 Jun, 2009 11:59 am
by benryves
Ace. Could you use it for billboarded sprites in Aether, maybe?

Re: Progress Thread - New demo - Cobra Mk III (18-May-08)

Posted: Sat 06 Jun, 2009 1:18 pm
by Galandros
Looks nice. Ah, I need to master images handling. I could can make cool stuff.

Re: Progress Thread - New demo - Cobra Mk III (18-May-08)

Posted: Sun 07 Jun, 2009 7:58 am
by qarnos
benryves wrote:Ace. Could you use it for billboarded sprites in Aether, maybe?
Hmmm... if I was going to use it in Aether, there's no real reason to restrict it to billboard sprites. It could get ugly if you use a texture on a high Z-depth polygon, but on a 96x64 b&w display, who's going to notice?

Here's an example of what it could look like. This is a 64x32 image of an Apollo spacecraft scaled to an (initially) square polygon. After the rotation, the polygon is warped around a bit.

Image