[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Faster OBJ loader



Hi,

The display list caches all operations inside of it.  You are correct that some display lists take longer to call than others, as the cached data may be different.

In your example, notice that you're bounding the draw code in the display list, so you're caching the fixed function or the vertex arrays.  Vertex arrays are slightly faster than fixed function, even when they are cached, which is why the vertex arrays seem faster here--because you're really drawing the vertex arrays as a display list!  However, if you were drawing vertex arrays normally, versus fixed function in a display list, the fixed function would be faster. 

In order of increasing speed:
1. fixed function
2. vertex arrays
3. display list of fixed function
4. display list of vertex arrays
5. VBO

My comment was that 2 is slower than 3.  However, your test program is testing 3 against 4.  Usually 4 is not done--it's generally 5 if you need the flexibility of vertex arrays.  Generally when saying "vertex arrays", that means the program uses no display lists (i.e., 2 is meant instead of 4). 

Incidentally, thank you so much for providing an example!

Ian