Re: [PyOpenGL-Users] 2d sprite engine performance.
Brought to you by:
mcfletch
From: Erik J. <ejo...@fa...> - 2005-04-06 16:48:14
|
On Wed, 6 Apr 2005 09:05:32 +0800, "Simon Wittber" said: > It would seem we have been working on similar projects. My project > however, has been much for of an experiment, and a learning tool, than > a serious development effort. > > http://developer.berlios.de/projects/lgt/ I will have to take a look at your project. I expect a lot of people have made 2d sprite engines with OpenGL, but I wouldn't think that it has been done in Python all that often. > > I have set up an experiment using my game engine to draw unmoving > > sprites in a window and do nothing else. On my 500mhz G3 iMac with a > > Rage128 Ultra, I can draw about 250 items before the frame rate starts > > dropping below 30fps. Is this a reasonable number? > > I don't know much about Mac hardware, but these numbers seem fine to > me. I ran my demo code on a 2.6ghz Pentium 4 with a Matrox G400 video card, and that machine can handle about 1400 sprites @30fps. I guess that is pretty good, but I had hoped that 3d hardware acceleration would have let me do much better on the low end hardware. Instead it seems that I am very CPU bound. I wonder if I am actually getting anything out of OpenGL, or if I could do better with normal PyGame using SDL surfaces. Perhaps this is a question for the PyGame mailing list. > Personally, I would me quite impressed if my own 2DGL library had > these sorts of figures on similar hardware, but perhaps I have low > expectations... One thing to keep in mind with the numbers that I am quoting is that they are taken from a very simple demo that does nothing but put sprites on the screen and measure fps. The actual game code has more overhead. When I think of the number of textured polygons that a game like Quake can put on the screen, the 250 that I get on my iMac seems so low. I guess a lot of those polys in 3d games are static though, and can take advantage of display lists and vertex arrays. If you are looking to improve performance in your own code, the most obvious win that I found was grouping all of my textures onto a single big texture to avoid texture swaps. Minimizing color changes also helped. Erik |