With a lot of state changes, I'm thinking it might be time-saving to do a visibility check. I've found with the multi-texturing quake level render that simply throwing it all into a batch, even with optimally arranged groups for the textures, has wildly varying results, map to map. Some maps have a much lower framerate than others, and the difference is not geometry but the number of state changes. The .bsp file has pre-computed PVS information which I could take advantage of, the question is would it actually save time.
It has been very interesting working on this .bsp renderer, since the structure was designed years ago and has many optimizations, some of which make no sense on a modern computer/GPU - but might have application with pyglet. I am using this process as an exercise to help me understand how to design a pyglet-specific engine. The fact that I have not done any game programming of significance since the mid 90's also gives me an odd perspective of pyglet's performance. Pyglet seems on the one hand astonishingly fast (when the GPU is lifting the load), but at other times it presents significant challenges for optimizing either by design of the game, data structure, code, etc. I will explore the second two options you suggest and see what I get. Thanks for the thoughts! -price On Aug 22, 8:40 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote: > On 8/23/08, stampson <[EMAIL PROTECTED]> wrote: > > > > > How hard would it be for a group in a batch to have a visibility > > toggle? Or would it be better to simply have multiple batches? > > There are a couple of OpenGL tricks you could use in Group.set_state > to effectively make a group invisible (for example, setting a 0-size > scissor region, or translating everything out of the view frustum). > This still has the performance overhead of sending the geometry to the > GPU. > > It would be possible to modify Batch to check a visibility flag on > each group before drawing, but this obviously adds a performance > overhead for every group draw (if you're interested in doing this, > you'll need to modify the lambda function within > Batch._update_draw_list). > > Alternatively you could modify _update_draw_list to omit invisible > groups, and rebuild the draw list whenever visibility changes (you > would have to manually trigger this). Whether this is feasible or not > depends on how often groups are changing visibility. > > Alex. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
