[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] pyopengl sprite/particle performance
- To: pygame-users@xxxxxxxx
- Subject: [pygame] pyopengl sprite/particle performance
- From: flx <xf3l1x@xxxxxxxxx>
- Date: Sun, 15 Jun 2008 22:21:00 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 15 Jun 2008 16:21:06 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=zyUn8pEwinHTBpXgIO2EfAuCqAxdiG9z75n/TtDcEXY=; b=Gw1K5OLsCye0Fdz/mDP7JojLjmlBKT4DhV8lOD4D7SXJzmTK5SF2yE59+TzhzEEw4w s1XebVpzgjjeF04KPZwsmKNttDXdHJ7mv0HoJnGnK5c+rrVSVk14/f2weixwYu9Eip7s oY3srGuawIzGZzy2rIIapsA10i3kIcFa4vQb4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Uzpj6rHtmZz7nSEAnJRY6UD0JC52pfjHU4REABYdeAyFyXCj/0fLNFp9DWzge7o2MQ SurG7IMnaCw+MHBinEPYxl/oBNqYEIvX/lHN+8S+nC/Adagm89xd/t4Q8uHQ4E1AWe+/ kIMH3PCKeEoKom/CzjHJB67kHIlpxBgMwFqRU=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi all
I've been fidling for some time with pygame on a tryout project [1],
it's a fast 2d action game.
After a while i switched the drawing code to pyopengl looking for a
litle performance boost, but i haven't got the expected results, i
have had to lower the global fps from 60 to 30 and even then, it lags
with 150-200 sprites on screen.
I know there must be something wrong with my code because there are
more complicated things drawn with pyopengl.
This are the first lines of profiling output (switch to monospace font now ;) )
6202178 function calls in 52.748 CPU seconds
ncalls tottime percall cumtime percall filename:lineno(function)
148066 6.507 0.000 28.780 0.000 gl.py:114(draw)
200620 5.532 0.000 27.806 0.000 wrapper.py:650(wrapperCall)
200616 3.828 0.000 3.828 0.000 numpymodule.py:114(contiguous)
200616 3.579 0.000 5.622 0.000 numpymodule.py:19(dataPointer)
766540 2.803 0.000 3.000 0.000 error.py:167(glCheckError)
440660 2.368 0.000 3.815 0.000 ship.py:60(_collide_bullet)
code referenced is on [1] or running > svn checkout
http://pyship.googlecode.com/svn/trunk/ pyship < recomended since the
tarbal is several days old and there are some particle and sprite
especific examples on the svn
[1] - http://code.google.com/p/pyship/
--
.__.·º(foolhu!)
(oO)
/ | | \