Optimized Lists

I wonder… what’s better ?:

  1. Triangle lists like:

    • Generate a new compiled list with
      glBegin()…

      glNormalf(nx,ny,nz)
      glVertexf(x,y,z)

      glNormalf(nx2,ny2,nz2)
      glVertexf(x2,y2,z2)

      glNormalf(nx3,ny3,nz3)
      glVertexf(x3,y3,z3)

      glEnd ()

      for 4000 vertices… OR

  2. Generate a new compiled list, using interleaved arrays, drawElements, etc… INSIDE the list

Thanx!

If you’re making a display list (compiled list) then it doesn’t make any difference how you make it. glvertex*, glDrawElements, etc… as it’s all gonna end up in the same format anyway. (afaik)

If your vertices need to change though, then display lists wont be good, as you’ll need to keep compiling them up.

I have a question also.

glDrawElements, hops around your enabled data arrays yeah? How much of a performance increase do you get from glDrawArrays, (which just ploughs straight through all arrays??) and is it worth the extra memory used up from not having primitives derived from an index table?

If I stuck with glDrawElements, would it be worth optimizing the data, so that each triangles vertices, (as much as pos) were next to each other in their lists? (To help caching?)

cheers,
Nutty