On Mon, Feb 9, 2009 at 7:32 PM, Red15 <[email protected]> wrote: > > > Graphics cards don't draw quads, they will be split up into triangles by > the > > driver anyway. You are probably better off pre-triangulating (most > exporters > > and modelling packages have this option), and then rendering everything > as > > triangles. > > Done, a bit of a downer to this imo is the disk size but I guess in a > world where google throws gigabytes at your head you shouldn't bicker > about 1-2k more or less :)
The next step is to index the triangles, which improves performance immensely, but also reduces disk size a little. def compile(self): > self.gllist = glGenLists(1) > glNewList(self.gllist,GL_COMPILE) > for mat, vlist in self.ivlists: # ivlists are dicts where key = > material name and value = IndexedVertexList > > # Disabling next statments gives me frame boost > glMaterialfv(GL_FRONT, GL_DIFFUSE, > materials[mat]['diffuse']) I am pretty sure (but can't find a reference right now) that any glMaterial* calls inside a display list will disable major optimisation. > Do notice this is while compiling the list, apparently the list > actually also does the glMaterialfv and glBindTexture call each frame > which (I suspect) is pushing the texture down the pipeline each frame > (Ouch, poor PCIe bus ;) The texture won't be pushed through the pipeline every frame, as textures live in video memory (well, mostly), and all you are sending is a bind command. However, texture binds and material changes are expensive, so you are advised to batch your models by texture and material. If a single model uses multiple textures or materials, break it up into sub meshes that only use one of each, and render them separately. Again, if you move to using pyglet's vertex lists and batches, batching by textures will be handled for you. -- Tristam MacDonald http://swiftcoder.wordpress.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
