I’m using a display list to render a very complexe terrain. The terrain is static so I just put it in a display at the beginning and then I call the display list everytime I refresh the screen (the terrain never change but you can move, rotate, zoom, etc).
It works fine when I have around 100’000 triangles, but when I have a very complexe terrain (much more than 1’000’000 triangles) part of the terrain is missing. It seems that only the first triangles are displayed and the last ones are simply ignored.
Question is, are display lists limited in size?
Or are display lists loaded in video card memory, which would mean that my video card doesn’t have enough memory to handle so much triangles?
Could using several displays lists of 100’000 triangles each solve the problem?
Any help would be appreciated, thanks.
You should (must!) check glGetError after glEndlist to catch GL_OUT_OF_MEMORY errors.
If your system is running low on memory it might happen, that a display list build doesn’t succeed and the only way to communicate that to the app is via the out of memory error.
It’s beneficial to not put a huge amount of vertices in one big primitve inside a display list either, like glBegin(GL_TRIANGLES)-1M*glVertex()-glEnd().
Multiple primitives with less than 64k vertices (there are out loved 16 bits again) happened to show better performance in some cases.
Multiple display lists with those numbers should also work, esp. when you generate the terrain as patches (quad-tree like) and whole display list fall off the view when zooming.
Ok it was a good idea to check for errors, and I actually get a GL_OUT_OF_MEMORY error when part of the terrain is missing (GL_NO_ERROR otherweise).
Does it means that I have reached the maximum size of a display list, or that my graphic card doesn’t have enough memory for so much triangles?
I tryed to split my terrain in several display lists and it works, answered my own question. Thanks.