Re: [PyOpenGL-Users] 2d sprite engine performance.
Brought to you by:
mcfletch
From: Erik J. <ejo...@fa...> - 2005-04-07 16:31:13
|
Last night I removed the immediate mode calls in my code and replaced them with each sprite having it's own Display List. With little effort it yielded a very nice performance boost. My iMac went from being able to handle 250 sprites to working well with 370. I have a minor issue to sort out with scaling, but the impact on my code was very minimal. Interestingly, the P4 that used to do 1400 sprites can now do about 1520 at 30fps. I think this machine might actually be gpu bound, but it is funny to see the exact same increase between the two machines. Now I have to decide if I want to adapt my old vertex array code to the recommended method of keeping fixed indices for every object. The approach sounds like it could be very good for performance, but changing my code to use it would be a lot of work. I wonder if it would be enough of a win over display lists to be worth the effort. On Wed, 06 Apr 2005 20:41:00 -0400, "Mike C. Fletcher" said: > They are fairly serious about allowing efficient number crunching :) . > We just go along for the ride on the backs of their work :) . > Particularly, the in-place modifiers are a big part of the Numpy > interface. By the way, watch out for them too: > > In [6]:a = arange( 20 ) > > In [7]:b = a[5:8] > > In [8]:b += 5 > > In [9]:a > Out[9]: > array([ 0, 1, 2, 3, 4, 10, 11, 12, 8, 9, 10, 11, 12, 13, 14, > 15, 16, 17, 18, 19]) > > that's the same feature that allows the += delta, but it can bite you if > you don't keep in mind that the sliced array is pointing to the same > memory area as the original array. Very interesting. The Numeric modifiers are much more complex than I thought they were. Thanks for your help, this whole thread has been very informative. Erik |