CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Posts
    6

    Speeding Up Obj Loader for OpenGL

    Iv'e just got my latest project up and running, which is an .Obj loader iv'e been working on for the last few days, However it runs very slowly... like .5 fps if the object is mildly complex

    This is due because I call glBegin and glEnd for every pollygon, and when there 13,500 pollygons to draw, thats alot of calls to glBegin and glEnd so my main question is this...
    Is there a way to Draw Multipul Polygons without calling glBegin And glEnd For Every Single One? like some kind of seperator command

    Also I havn't yet but will put in a binarey tree (as soon as i can get the thing to work) How much speed increase can i expect from putting from a linked list.

    Any other tips or sugestions are VERY welcome.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Speeding Up Obj Loader for OpenGL

    You can use Vertex Arrays to help you out. If the geometry is relatively static, then you can gain even more time by downloading the geometry to the GPU once and then leaving it there; this is called the Vertex Buffer Object technique, and uses commands similar to Vertex Arrays except that you specify a GPU buffer as the data source rather than a pointer. Google it for details.

    On NVIDIA GPUs, you can gain quite a bit of performance by compiling geometry into a display list. (Other vendors support display lists, but in my experience they don't work quite as hard to optimize them as NVIDIA does.) A display list is often as good as a quad-tree for speeding up render times when only part of an object is visible. Display lists do not have to be used in conjunction with VAs or VBOs, but they can be.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured