April 23rd, 2010, 02:13 PM
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.
April 24th, 2010, 12:55 AM
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.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!