I wonder what I could trim off this.......
This is the main drawing loop, roughly.....
DIRTY RECTANGLE ALGORTHM calls dirty objects to be repainted...
IF OBJECT IS AN ISOMETRIC TILE draw it onto the volatile image backbuffer.
IF OBJECT IS A 3D MODEL clear buffer with MAGENTA, render, and set magenta as transparent colour with a special imagefilter. Draw to the volatile image backbuffer.
DRAW DIRTY BITS OF THE DIRTY OBJECTS to the screen.
Now, this looks pretty smoothly done, however, there are some things Id rather not do:)....
1. Have to call calcBoundingBox() for every frame, per object!
2. I heard of a back/front buffer on FrameBuffer. Do I need to have this? I assume its part of the way you render a scene? The framebuffer is only 200x200, so flipping from back to front is not a killer, but I will have to do it for each object.
You see I have to render each object by itself, which no doubt puts an overhead which isn't there when you make a true 3d game.
Well, those aren't massive problems. I'd be extremely happy if anyone can help solve these problems for me!:)
Using a MAGENTA background, was for drawing, and masking it for fast transparent. Unfortunately, I don't know how to do it in Java, so I have to use an image filter to make MAGENTA pixels have a 0x00 alpha value. It means I need to create a new image instance for EVERY 3D OBJECT, EVERY FRAME!
I bet that slows it down a bit.
About the bounding box... Egon tells me that it isn't too slow, if the models are low polygon. They are very low polygon. Still, I'm hoping for 10 3d objects onscreen at one time.
That is 10x calcBoundingBox, 10x renderScene, and 10x new image instance for MAGENTA to transparent. I CANNOT cache these renders. There is simply too many unique rotations, and animation sequences to make it plausible.
I must add, I'm not getting terrible FPS here. I have a constant 100FPS, and its clipped by me, to be no more than 100FPS, so it could be higher.
However, this is with just one model on the screen, on a 1.44GHz CPU, ATI Radeon with FGLRX drivers for linux.
The game which is my inspiration, LBA1, runs fast on a 233MHz(?) Pentium 1 CPU, with windows 95.
I realise Java is not going to work well with a mere "Hello World" app on this platform.
And, this is a pc from 1997.
Most people will have a broadband connection and at least 1GHz CPU right now. Most of the users of my website claim to:).
I also realise that Java is a virtual machine, and that it can never really reach the raw speed of proper, compiled code.
Regardless of this, I am trying hard to squeeze the most I possibly can out of this thing.
I know, I have typed a lot of rubbish here:). Any help is, like always, greatly appreciated. Thanks again:)