PDA

View Full Version : vertex array objects and huge meshes



caaso
02-11-2011, 05:58 PM
Hello folks!

This is my first post in this forum, so please dont be to hard.

I try to write a little mfc mdi program to display and manipulate vrml97 files. The vertex, normal, color data etc. of each mesh is stored as floats in stl::vectors. Parsing and storing woks fine. For diplaying I use one single vertex array object. And now the problem begins:
The vrml files contain a huge amount of data. I played around with some of the smalles files and I found out, that at a number of 360.000 faces still everything works fine and all is displayed correct. But if I try to display 560.000 faces or more, I only get a blank(white) window. The models are generated with "EVS" and there is no way to make them smaller or to export in a different format.
Would it be better to increase the number of vao`s or is the cause of the problem anywhere else?

greetz caaso

hhm...excuse my english if it is to terrible but it is already 02:10 am here in germany and I'm a little tired and frustrated ;)

Dark Photon
02-11-2011, 07:17 PM
There's so much stuff you're talking about here that has nothing to do with OpenGL that it's far from clear what your problem is.

Vertex array objects (VAOs) only store the bindings and enables needed for a batch, so it's doubtful that this is your problem.

Are you trying to render all these 560,000 in one batch? If so, split them up into multiple batches and retry. Also, how are you trying to render them?

Let's see the GL code you're using to dispatch these faces. As well as your GPU model and driver version.

caaso
02-12-2011, 07:04 AM
Thx for your answer Dark Photon.

Next time I will ask clearer question, without to much additional info.

I tryed to render the faces in multiple batches and that was the problem. Because of the structure of the vrml files, which contain various numbers of different meshes (sometimes > 300) I created one set of vbos (verts, colors, face index etc.) for each mesh. These number of vbos led to 100% cpu usage. After reading a lot of posts in different forums i realized the problem with the number of vbos.

So problem solved :D , now I can deal with millions of faces at 11% cpu usage.