Pathwalker (pathwalker) wrote,
Pathwalker
pathwalker

OpenGL

While glArrayElement(), glDrawElements(), and glDrawRangeElements() "hop around" your data arrays, glDrawArrays() plows straight through them.

(OpenGL Programming Guide, third edition)


glDrawArrays rocks -

I'm blasting 32K+ lit and smooth shaded polygons through the graphics pipe of an graphite iBook, refreshing 30 times a second, and I'm still under 33% cpu usage.

Plus, I'm running it in a nsOpenGlArea rather than full screen, and using the appkit timers rather than the glu timers as well so I have the extra overhead of Quartz, and I am interrupting the main appkit run loop 30 times a second.

Now, the only question I have, is how much caching the graphics pipe is doing. Right now I'm redisplaying the same model 30 times a second. If it is caching the entire thing (as the vertex and color arrays are left untouched) then I might hit some snags. Time to start playing with the buffers between glDrawArrays calls and see what happens...
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment