#24992 - DekuTree64 - Sat Aug 14, 2004 6:56 pm
Hmm, I'm not quite sure what that other guy meant either, but I am a little curious as to how your CZ-buffer idea would work. I tried a C-buffer once, but it was significantly slower than just throwing triangles at the screen. It was written in C though (compared to a C brute force filler), so I can't say how an ASM version would compare to an ASM brute force routine.
I have a feeling though that on GBA, you're not going to GET enough triangles on the screen for any overdraw reduction to help much.
What kind of worlds do you have in mind to render with it? I know you said only Y axis rotation, and that helps a lot, but you'll probably have to do some serious optimizing based on what sort of environments you'll be in, like indoor, outdoor, small corridors, lots of open space, hills and trees, or more square things like buildings.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#25052 - DekuTree64 - Sun Aug 15, 2004 11:19 pm
Hmm, sounds like a right fine plan, actually.
Here's what I'd do to sort of eliminate the frustum culling altogether. Your tiles are just flat on the 'ground' (X/Z) plane, right? So you only have to test against lines, rather than 3D planes, because the Y, or height from the ground, is ignored.
Instead of checking each map tile against those frustum lines, just look at the frustum as a 2D polygon layed out on the 2D ground. Either a 4 sided polygon, or to simplify things even more, ignore the near clipping plane, and it becomes a triangle. And what do you do when you have a triangle on a grid? You interpolate along the edges and draw it, of course. Just 'draw' the frustum triangle like a regular polygon, except instead of plotting pixels, do your 'I found a tile inside the frustum' code. Heck, you could even get free Z sorting by starting at the vertex closest/farthest from the camera.
..at least I think it would work. What do you think? Should I draw a picture to explain it a little better?
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku