Hey Elliot, The defragmenting buffer sounds interesting. How does it perform?
My solution to sorting was to keep a list of associated VertexLists in the OrderedDomain. The VertexLists themselves all have a reference to their parent domain (even if it's the default pyglet domain). Whenever any VertexList's depth attribute was changed, the parent domain is marked as dirty and gets sorted at the next draw call. It works fairly well, but I didn't have time to figure out the glMultiDrawElements stuff. For an experiment I rebasing off of the IndexedVertexLists, but I discovered that those seem to be broken. I don't know if this is just my machine, but it seems like any batch/domain that contains indexed vertex lists will fail to draw correctly if you delete any of the lists in the middle of the order. Indexed vertex lists are not really necessary for the sorting stuff, so I reverted back to plain vertex lists in my branch. On Saturday, December 10, 2016 at 9:22:52 AM UTC+9, elliot wrote: > > Sounds like y'all are tackling the same issue I did when I wanted to do > vectorized translations on vertex lists. I tried to use pyglets > architecture but it was so tied to domains being dumb and not keeping track > of what was in what they had allocated. This is for obvious performance > reasons, but my idea didn't mesh at all. > > I made a defragmenting buffer that keeps track of each allocated entity, > and an allocator that places new entities accordingly, rearranging the > buffer as necessary. Everything (with a common gl state) is rendered with > one glDrawArrays call. > > Sorry for the terse description. I'm on my phone. Let me know if I can > help. I'd love if pyglet had native support for ordered, contiguous buffers > that could interface with my entity component system. Maybe you can use > some code from the allocator. Here's the project: > > https://github.com/Permafacture/data-oriented-pyglet > > Elliot > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
