On Tue, Dec 23, 2008 at 7:20 AM, dasacc22 <[email protected]> wrote: > > Hi, > > Im working on a universe model using pyglet and dont have a great deal > of experience using opengl and have a couple of questions. First, is > gluSphere just as efficient as pyglet.graphics.draw_indexed ? I dont > even know how to create curvatures with the latter.
It may use vertex arrays under the hood, but I don't think the spec makes any guarantee about that. If you want to make it as fast as possible, you should compile it into a display list. On a more general note, I would use the solution that is easiest to code first and worry about performance second. gluSphere is likely much simpler to code, so use it first instead of rolling your own. If it's not fast enough, use a display list. If it's otherwise unsuitable later, then roll your own. You almost definitely have bigger fish to fry at first. > And Second, is > there some way for me to tell how much memory a particular object (say > its vertices and color data) is taking up in video memory? Different platforms and video cards have different tools available. So the answer is "it depends". > Ok and one more question on the subject of video memory, does empty > space take up any memory? say i had two stars to scale that were > distanced from each other to scale, which would be quite a distance, > does all the extra empty space do anything to video memory? Vertices are typically not the major consumer of video memory for most applications, textures are. But to answer your question, no. It doesn't matter how far apart objects are, just how complex they are (i.e., how many vertices they have and other data). Note that you can run into other problems with extremely large coordinates values, namely the coarse resolution of 32-bit floats at high values. But I'd only worry about that if it rears its ugly head. Likely with spherical objects, like planets, you can reuse the same geometry (a sphere) over and over again to draw them. Just translate, rotate and scale appropriately for each planet, setup textures and draw the sphere. Many video cards are optimized for repeatedly drawing the same geometry, so it can give you nearly ideal drawing rates. -Casey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
