[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Fun with C modules




> How many triangles are in the display list? I don't have the luxury of 
> display lists since the triangles share no similarity, being part of a 
> landscape. I use display lists for other things though, like trees, etc. They 
> definitely help there :)


i think jan means draw the landscape using drawlists. even though you 
only use it once per frame, it means you only need to make a single 
function call to render the ground. (thus python gets out of the way)

i have a feeling using vertex buffers to do this sort of thing is a 
little more efficient. especially if the landscape needs to change a 
little. just change a couple numbers in a Numeric array, and you still 
draw the entire landscape with a call to glDrawElements, or something 
similar.

if i recall your original letter correctly, you're also using some sort 
of culling, which definitely helps.. i guess you'd want to break the 
landscape into different drawlists/vertexbuffers for the difference 
sections of the landscape that can be culled?

anyways, the lesson definitely is, using "glVertex" for your rendering 
in python is definitely going to take a performance hit. but glVertex 
isn't really used in C 3d games either. for performance they all use the 
draw lists and vertex buffers. and the good news is, there's hardly any 
performance penalty using these functions in python :]

still, all the culling functions will be quicker in C, i've just not 
played with it that stuff to really know how much quicker.




____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org