http://www.angelfire.com/ar/agc/download/parallax2.tgz
http://www.angelfire.com/ar/agc/download/parallax3.tgz
The new version is a simple and unoptimized implementation of
"overdraw elimination". It’s recursive and eliminates all overdraw
if only opaque tiles are rendered, and still supports color keyed and
aplha blended tiles.
hey, i like this scrolling example, reminds me of some great games in the
old days
i’m just asking myself if this couldn’t be all done with opengl, the
graphics card would do all overdraw elimination.
Yep, I’m working on that as well.
do you think it would run slower using opengl? (assuming you have a
3d-acceleration card, of course;)
Nope, it’s fast as h*ll, even on cards that aren’t exactly state-of-the-art.
The animation quality is also very much higher than anything software based,
as the texture filtering can be used for sub-pixel accurate positioning (ie
speed becomes independent of refresh rate without compromizing animation
smoothness), and alpha blending can be used to implement antialiasing. (Well,
both of those are of course possible to o in software as well, but the former
is beyond the power of today’s workstation CPUs, at least for sensible
resolutions, like 640x480+.)
is it for people who don’t own a 3d-card or am i missing another important
point?
That’s basically it, although software rendering does have the advantage of
always producing the same result, as opposed to hardware accelerators.
Then again, from what I’ve seen so far, any card with any kind of texture
filtering does better than a software rasterizer, even if it doesn’t filter
the alpha channel, so I think most gaming machines will produce better
results with OpenGL. Basically any AGP card and most of the PCI "gaming"
cards should be up to it. (Alpha blending and texture filtering must be
possible to do at the same time.)
timo
ps: just kick me to the right topic if this has all been discussed
somewhere else.
Look for “Accelerated 2D APIs” and “hw filled polygons & hw l ines”. We have
discussed related stuff in other threads as well, IIRC, but I wouldn’t say
there is any single right answer here - it depends on how heavy effects you
need, what kind of quality you demand and what kind of users (ie “hardware
requirements”) you target.
Personally, I really want perfectly smooth animation (scrolling in particular
- that’s where it’s most important) at full frame rate, which basically
requires OpenGL regardless of the amount of graphical effects. This is partly
because you can’t reliably select any specific screen refresh rate, but also
because if even if that was possible, it would still constrain scrolling and
object movement speeds to fixed integer pixel/frame numbers. A third problem
is that modern hardware isn’t designed for software rendering, which makes it
virtually impossible to achieve full frame rate that way, regardless of CPU
power.
(You’d think a P-III 933 should handle 640x480x24 @ 100Hz easily, but there’s
actually no way to do it, at least not with the drivers and methods I’ve
tried so far! Meanwhile, I can do that with some 2-4 times overdraw with
alpha blending using OpenGL on the Matrox G400 - and it makes any 2D
animation I’ve ever seen before look ridiculous…)
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -'On Friday 23 February 2001 16:40, Timo Peichl wrote: