[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Fun with C modules
On Thu, 20 Dec 2001, Pete Shinners wrote:
>
>> 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.
Yep. OpenGL calls them "display lists", and they are one of the easier way
to increase performance.
>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.
Yep again. I think today's drivers and hw are optimized for vertex arrays.
I'll try them some day when I have some extra time.
>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 :]
Well, using display lists for the drawing still uses glVertex() for the
initial drawing, but after that you draw a list using glCallList().
--
Many an ancient lord's last words had been:
"You can't kill me because I've got magic aaargh...."
-- Terry Pratchett, Interesting Times
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org