On Sat, Jul 5, 2008 at 11:21 AM, altern <[EMAIL PROTECTED]> wrote: > > hi all > > today i am trying to catch up with the newest pyglet API. It looks very > nice although a bit weird at the first moment. I am working on this > simple example where many instances of an object are rendered on random > locs on screen. On my Desktop this takes almost 80% CPU, i am pretty > sure i am doing something wrong because most of the CPU time is taken by > the render method, (If I comment render() out it drops to 4% CPU). > > any suggestions? I am on Debian, on a PIV at 1.7 gz . Below i paste the > script i am working in. >
I would suggest using pyglet.graphics.Batch to store vertex lists and just modify the vertex data, rather than calling OpenGL transform calls for moving your quads - this might not solve you cpu utilization problem completely since you still have to update 500 quads for each frame (*), but your framerate should increase by a significant factor. There is sgood documentation on this in the graphics section of the programming guide for 1.1. (*) If you have to update lots of things at a rapid rate, you're going to use the CPU. Unless you're doing something fancy like CUDA. Also, unrelated to your problem, but pyglet already sets up an orthographic projection for you in the window's on_resize() - you don't have to do this in your setup() function. -- \\\\\/\"/\\\\\\\\\\\ \\\\/ // //\/\\\\\\\ \\\/ \\// /\ \/\\\\ \\/ /\/ / /\/ /\ \\\ \/ / /\/ /\ /\\\ \\ / /\\\ /\\\ \\\\\/\ \/\\\\\/\\\\\/\\\\\\ 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 -~----------~----~----~----~------~----~------~--~---
