This isn't a new discovery I'm afraid. It's been stated before that
pyglet is no good at systems like this (in particular particle
systems) where there's a large number of changes being made to OpenGL
data structures in a single frame. The Python / ctypes overhead is
just too great, as you've discovered.
I recommend the lepton particle system implementation which I've
previously used to good effect and it handles way more particles than
you're describing here.
http://pypi.python.org/pypi/lepton
Richard
AFAIK Rabbyt works by creating GL display lists under the covers. If
that's the case (it certainly was when the project started) then it's
not really suited to particle engines either.
Richard
On Aug 24, 5:07 am, mclovin <hanoo...@gmail.com> wrote:It's not pyglets fault really.
> Anyways, I am just horribly dissappointed by Pyglet. I used it for
> about a year and always just excused some of its performance lags
> because it was a scripting language. but a scripting language in a
> browser kicks Pyglet's *$$
1) ctypes FFI calls are slow
2) Chrome JS isn't really a "script" language, it gets compiled down
to x86/x64 machine code
However, 7500 particles is not so much. Doing the draw loop in C I get
to 20'000 particles @ 60FPS. See http://codeflow.org/particles.tgz,
which in essence is
It is in fact possible to create a particle system on the GPU complete
with collision detection and "interesting" behavior. It requires using
render-to-texture techniques with floating point textures. In fact the
first google hit on "gpu particle system" is a presentation on such a
system.
That said, it doesn't look very easy 8^)
What video drivers are you using (glxinfo "OpenGL renderer string")?
What FPS do you get out of glxgears? If you're coding this stuff by
hand and not using pyglet's texture management code then are your
texture dimensions power-of-2?
Richard