Hi all,

I'm working on a python framework that sits ontop of pyglet.
https://github.com/adamlwgriffiths/PyGLy

My modern opengl knowledge is limited and I'm trying to find the best
way to render meshes. The best example of what I'm working on
optimising is my implementation of Wavefront OBJ meshes.

My current implementation uses a single display list and simply makes
opengl calls (glVertex3f, etc).
https://github.com/adamlwgriffiths/PyGLy/blob/master/pygly/mesh/obj_mesh.py

This works and is flexible, but the number of calls from python -> c/
opengl causes the load time to increase.
My MD2 loader parses the MD2 file almost instantly, but pushing into
OGL takes around 10 seconds using the same method as my OBJ
implementation.

It looks like the obvious optimisation would be to batch up the
vertices into a VertexList / IndexedVertexList with the appropriate
format specified and do a few pyglet / opengl calls rather than the
hundreds that I'm doing currently.

My problem comes with the usage of multiple groups of primitives
within the 1 set of vertices. Ie, multiple tri fans would share
vertices.
I'm not sure how to create multiple lists of indices without
duplicating the vertices.
As most of the tri fan groups have only about 3 - 5 vertices, this
would be a massive waste.

Even better would be to use Pyglet's Batch, that way different index
groups can use different textures, which I will have to do to support
the OBJ format properly.

So my questions are:
Can I specify multiple groups of indices in an IndexedVertexList? If
so, how?
Can I do this with a Pyglet Batch object? If so, how?

Hope my question makes sense. Apologise if this is an obvious
question, but I'm very much 'example driven' and I'm having trouble
finding one that matches my problem.
Thanks for your time and help =)

Cheers,
Adam

-- 
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.

Reply via email to