View this page "Pseudo Fluids With Pyglet And Pymunk"

29 views
Skip to first unread message

viblo

unread,
Apr 8, 2008, 12:57:52 PM4/8/08
to pyglet-users


Click on http://groups.google.com/group/pyglet-users/web/pseudo-fluids-with-pyglet-and-pymunk
- or copy & paste it into your browser's address bar if that doesn't
work.

viblo

unread,
Apr 8, 2008, 12:59:26 PM4/8/08
to pyglet-users
Whopps, didn't mean to make this post, just slipped on the button
while I removed the advertising spam...

/viblo

On Apr 8, 6:57 pm, viblo <v...@viblo.se> wrote:
> Click onhttp://groups.google.com/group/pyglet-users/web/pseudo-fluids-with-py...

rollbak

unread,
Apr 16, 2008, 10:40:27 AM4/16/08
to pyglet-users
Hi, did you have some example code to share, i'm using pymunk+pyglet
and i 'm having lots of performance problems when i have to draw a lot
of circles (i use raw open gl to do that).
Thanks.

Lucas

Drew Smathers

unread,
Apr 16, 2008, 11:40:14 AM4/16/08
to pyglet...@googlegroups.com

Fluid dynamics (even `psuedo-', as you say) in Python is going to be
slow ... period. You can't optimize the function call overhead with
display lists, for one, because your circles will likely move
independently of one another. :(

There are certainly opportunities for clever cheats in the context of
games where you can overlay textures (or use 3d textures ... or use
some shader), but you not going to achieve decent performance with a
bunch of circles (unless you write it in C - and you'll still have
very finite bound on the number of circles you can get by with ...
just much less finite than with Python). There could very well be
other approaches yielding good results in Python - maybe use a
B-spline for the surface? I'm a dilettante on theses matters -
complex OpenGL operations make my head explode.

Anyhow the future might offer us more directly on the GPU:
http://www.bulletphysics.com/Bullet/wordpress/uncategorized/gpu-physics-demos-in-the-cuda-11-sdk

--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s

Richard Jones

unread,
Apr 16, 2008, 6:01:48 PM4/16/08
to pyglet...@googlegroups.com

If your circles could be drawn with (pyglet.sprite) sprites then you should
see an improvement. With a little effort you could also adapt the fire
particle demo posted to the pyglet-users page which would give you a little
more speed.


Richard

Andrew Straw

unread,
Apr 17, 2008, 1:18:10 AM4/17/08
to pyglet...@googlegroups.com

rollbak

unread,
Apr 17, 2008, 10:01:22 AM4/17/08
to pyglet-users
Thanks all, in my attempts of improving performance y try using
sprites and batches and increases a lot.
Reply all
Reply to author
Forward
0 new messages