On Mar 25, 2:54 pm, Lucio Torre <[EMAIL PROTECTED]> wrote: > Hi all, > > i forgot to ask richard this question. I know vertex buffers are > supposed to be fast, but reading the sprite module i see that when i > update the scale or rotation or position, all vertex for the image are > recalculated in python code. > > Why is this? Is this faster than glrotate+glscale (whateveritsname) ? > How come?
I'm not Richard, and I'm not a pyglet expert, however from my investigations I can provide the following comments. The advantage of the sprite + pyglet.graphics modules is that an entire batch of sprites can be drawn with just a few GL function calls. The disadvantage is that the vertex array has to be updated whenever sprite attributes change. IMO this makes pyglet.sprite great for static sprites, but less great for lots of moving sprites. I suspect this could be resolved if pyglet provided some functions for batch operations on vertex arrays. This would probably require a small C module similar in spirit to AVbin. Overall the pyglet.graphics API is still great of course, but being aware of the implementation details you mentioned will help if you ever notice a performance decrease when using a bazillion moving sprites. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
