[SDL] Speeding up glClear?
koshmaar at poczta.onet.pl
Thu Jan 6 12:58:31 PST 2005
> I distinctly recall liberally using IDCLIP, heh. Excellent, this will
> be where I start then - thanks much! I'm very curious to know,
> though, why mapping a texture across the entire screen would be so
> much faster than setting a single color value across it all. Any
> insights to offer?
Not sure, but...
1. When you call glClear and render any other thing, you end up touching every pixel multiple times, because every frame you must fill whole screen with zeros; while using Z buffer you only render what would be visible (not "culled" by other object pixels) - so, you save a whole lot of fillrate.
2. Odds are that texture you map on the screen, will include touching much smaller pixels than screenWidth*screenHeight, note that it also can change per frame ie. 30% of texture surface can be clipped by screen, 20% by other polygons in Z buffer etc., so in this case GL need to render only 50% of what original texture was - another big gain; glClear touches all pixels no matter what is happening on the screen.
3. Other reasons, forgot or don't have time to write them ;-)
P.S. Sorry for clumsy english...
More information about the SDL