PDA

View Full Version : Corrupted image when the mesh gets larger.



Vadim
04-07-2010, 07:02 AM
I have a piece code that renders a mesh using VBO. It works OK but when the number of vertices is getting close to a milion a part of the image gets corrupted. This does not happen for example on NVidia 9800GT but many older videocards do show the problem. Same thing happens when I use vertex arrays instead of VBO.
I spent some time to reorganize the algorithm to split the mesh into several smaller pieces and put them into separate VBOs. But to my suprisies when I finished I still see the problem.
The vertices that come first render correctly but when the vertex count hits some threshold the mesh displas banding and some vertices are missing. Did you experience something similar ?

FrimaMichael
04-07-2010, 07:12 AM
I am very new to OpenGL myself but this looks like vertex data not drawn always using the same orientation. The "winding" of every triangle you draw should be the same. Also if you draw using quads you have to be sure the vertex are on the same plane. Applying transformation to quads can displays the problems you seem to be having if the vertex are sligtly changed with rotation for example (floating point issues).

Like I said, I'm very new to OpenGL so that may not be your problem. Anyway, hope this can help.

Vadim
04-07-2010, 09:14 AM
I am afraid the problem is somewhere else.
Below is the corrupted part of the mesh. Since the same code runs without problem on more recent videocards I do not expect an error in the mesh creating algorithm. Is there a limit on how many vertices one can display ? I start seeing the problem when the number of vertices is close to a million. The size of the data per vertex is 48 bytes so it comes to 48 MB - still not to big to not fit into most videocards memory.
http://farm3.static.flickr.com/2736/4499795113_582bb44efd_o.jpg

FrimaMichael
04-07-2010, 09:48 AM
I found out about this on another forum :



glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &value);


How do you draw the vertices ? Maybe you exceed the limit of elements you can draw with one call ?

Here is the link, hope it helps :

http://gpwiki.org/forums/viewtopic.php?t=8839

Vadim
04-07-2010, 09:54 AM
Yes, in my original post I mentioned that I split the mesh into smaller pieces, which did not help at all.

FrimaMichael
04-07-2010, 10:24 AM
Well, sorry I don't know what could be the problem then. Hope someone with more experience can help. Good luck !