Currently I have one buffer for my vertex data and one buffer for normals data. I fill them and then pass them to OpenGL for rendering.
The problem is when I load too large mesh file like "Lucy" from Stanford
The program stops responding or the computer freezes. I allocate my buffers like that:
Vector* vertData = new Vector[numVertices]; // then fill the array with data
numVertices = 14 027 872 in this case. That allocation doesn't throw bad_alloc exception so I guess there is nothing wrong with the allocation of memory.
I am testing the program on a x64 windows 7 platform with 4GB RAM and GTX 470 which has 1280MB of memory. Windows task managers shows that the program uses about 2GB ram when I run it.
Note that when I choose to render not all the voxels of the mesh - every 2nd for example, then I have no problems. Maybe the GPU runs out of memory and that's why the program hangs ?
Shoud I split my mesh data into more vertex/normal buffers and then pass them to OpenGL one at a time or there is a better way to do this ?