[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OpenGL vs. SDL for 2D
Thank you for the great information in general and the texture layout tips
in particular! I'll research the matter deeply, though ;-))
You said "push pixels hundreds of times faster than you can with
the CPU alone". I wonder why you say "with the CPU alone"
Isn't it that even a simple S3 Trio64 does 2D blitting through its own CPU
and relieves the burden on the main CPU?
So what you said still holds true l when you compare SDL on a GeForce2 and
OpenGL/Mesa on the same GeForce2, right?
Simple example: a plain blit/flip of a 800x600 screen
That's the last piece of the puzzle, and I think I made a decision already!
So why use SDL (without the OpenGL wrapping part) from now on then? It would
die out relatively quickly if this is the situation.
Is this the reason why your PLib skips over the SDL concept, too?
Long live OpenGL/Mesa! (Short live Microsoft patent pirates ;-)! )
----- Original Message -----
From: "Steve Baker" <email@example.com>
Sent: Thursday, February 28, 2002 7:04 PM
Subject: Re: OpenGL vs. SDL for 2D
> > Vesselin Peev wrote:
> > I'd like to ask if it is possible to achieve better 2D performance
> > in plain sprite blitting by using OpenGL/Mesa instead of using SDL
> > on a decent 3D graphics card?
> Yes...easily. If you load your sprites as textures (preferably packing
> lots of them into large textures to avoid texture switching) and you'll
> be able to push pixels hundreds of times faster than you can with the CPU
> alone. You'll get scaling, antialiasing, rotation and transparency for
> and you can also use the Z buffer to allow sprites to move behind
> layers without the need to worry about the rendering order.
> This is nice because at the same time as getting all of these speedups and
> quality improvements, your CPU is actually doing *LESS* work - so you have
> more time for AI, music, etc.
> > I know the inconvenience of using special dimensions for the sprites
> > OpenGL/DirectX...
> Not really. For sprites, pack as many as you can into large maps. The
> maps have to be even powers of two - but the sprites *within* the map can
> any size you like. (Modern nVidia graphics cards can actually do
> maps too - although there are some restrictions, they shouldn't affect
> > but it does not really matter these days, does it? Also, older hardware
> > would not be supported, but if a considerable performance boost is
> > that wouldn't matter, too.
> Indeed. I think it's been a reasonable decision to presume the existance
> fast 3D hardware for at least a year now. There will be some hold-outs
> still have antique hardware - but they won't seriously reduce the size of
> ----------------------------- Steve Baker -------------------------------
> Mail : <firstname.lastname@example.org> WorkMail: <email@example.com>
> URLs : http://www.sjbaker.org
> http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
> http://prettypoly.sf.net http://freeglut.sf.net
> http://toobular.sf.net http://lodestone.sf.net