On Wed, Mar 5, 2008 at 11:07 AM, Serg Kovrov <[EMAIL PROTECTED]> wrote:
>
> Drew Smathers wrote:
> > Regarding the performance issues, my first guess is that you have
> > update and draw function per particle in the system - because the
> > addition of 1 function call cannot hurt performance but N/2 vs. N
> > functional calls is a significant optimization. If my wild guess is
> > true, then consider putting all your particles in one class
> > (ParticleSystem) so you have at most 2 function calls per particle
> > system (unless you make calls to change their positions - I hope not).
> > I have more guesses ... but that would lead us to a game of charades.
> >
> > Anyhow, please post some code, so someone can perhaps point out where
> > the bottleneck is.
>
> I am not experiencing a bottleneck yet, but rather have concerns in
> general.
>
> It is not additional function call i don't like, but additional for-
> loop iteration per particle system (one in update, other in draw)
>
Well, if you want to avoid looping twice, use the update method as a
chance to simply parameterize the draw method. Again, this is simple
if you're doing things the OOP way. I'd be more concerned though
about how many particles are in a single system. Don't expect blazing
performance out of Python's VM. If the particles didn't move (which
would be pointless, right?) you could use display lists, etc. There
are other ways to make a better performing and more visually
interesting particle system - GLSL taking parameters etc - w/out
making a C-extension.
> Speaking of measuring performance - i have a question: how to force
> `pyglet.clock.schedule` to call my update routine as fast as possible?
> It seems to have cap 60 frames/sec. I have turned off vsync for my
> window, but it doesn't help.
Are you setting an FPS limit? Again, some code will help others
understand your problem.
--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---