PDA

View Full Version : what kind of rendering? huge vertices & need edit



Alex Chen
04-08-2010, 09:57 AM
hello,

I have an application which deals with up to "5 millian vertices" models. I used Immediate Mode to render the model but the rendering is slow whenever I change the viewpoint (i.e. rotate, translate & scale the object).

I can not use Display List because I need to edit (ex: select/cut part of the model, i.e. changing the number of vertices) the model within the application. Then I have the choice of Vertex Array or VBO (Vertex Buffer Object, preferrable than Vertex Array), in which I may change the contents of index for the array (even though I am not 100% sure that will work, but as my understanding it should? ).

However both Vertex Array & VBO have the limit of "GL_MAX_ELEMENTS_VERTICES / INDICES"

( refer to http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=125297 )

that for my video card, GL_MAX_ELEMENTS_VERTICES = GL_MAX_ELEMENTS_INDICES = 1048576, so for a 5 millian vertices model the performance will suffer ...

Does anyone have experiences writing application to deal with such a large amount of vertices and meanwhile need to change the contents of the model ?? What kind of rendering technique should I use ??

thanks a lot,

alex

Alfonse Reinheart
04-08-2010, 10:49 AM
However both Vertex Array & VBO have the limit of "GL_MAX_ELEMENTS_VERTICES / INDICES"

No, they do not. That limit is for using glDrawRangeElements. This function is for faster drawing, but with restrictions (like staying within those limits). glDrawElements has no limits.

dorbie
04-08-2010, 12:16 PM
I'm stupefied.

Even if it were a hard limit, you see there's max vertex and think there's a problem? You can issue more than one call.

Performance gains hit seriously diminishing returns once you start issuing a lot of vertices.

Fugitive
04-09-2010, 04:01 AM
I am rendering about 20+ million points/vertices in real-time. I don't have any problems with limits as such. As long as the memory is enough, it should be fine.

I have not done any real-time editing of the vertices though. Its a static model.

@Dorbie: What's "max vertex"?

Alex Chen
04-09-2010, 06:25 AM
@Fugitive: by "rendering about 20+ million points/vertices in real-time" you meant rendering the model in "Immediate Mode" or "Display List"? Did you not have any delay whenever you change view point (rotate, translate & scaling)? Do you render only points, or triangles with colors?

I think Dorbie's "max vertex" was referring to my "GL_MAX_ELEMENTS_VERTICES / INDICES"

Fugitive
04-09-2010, 11:13 AM
Alex, I have tried all three. Using immediate mode is insansely slow, obviously.

Display lists stop working on some cards (I tried both ATI and NVidia) beyond a certain number of vertices (about 10+ million I think). My assumption is thats because Display Lists take more memory than raw vertices and the GPU was running out of memory. There was definately lag in rotation/translation, but it was still useable at 10 million or so vertices. It was interactive.

Using VBOs currently, I get completely smooth movement. One thing to note is that I was drawing points rather than triangles. Triangles/polygons are dog slow beyond a few million polygons, even on VBOs.

As for "GL_MAX_ELEMENTS_VERTICES / INDICES", as Alfonse pointed out, thats for glDrawRangeElements only.