I am creating a terrain system using voxels in a somewhat minecraft-like style and I was wondering if there was anything I could do to increase the number of vertices I am able to store (and therefore render).

Based on different suggestions I have read I created a number of "chunks" of size 32x32x32 cubes and all of the vertices for these cubes are pre-calculated and stored in a VertexBuffer. I then have 7x7x7 of these creating a larger map. Therefore this is around 11 million cubes.

I was unable to render all 11 million cubes, so I removed any vertex in the buffer which would be completely hidden by an adjacent block (this removes all the interior/invisible surfaces/vertices). Overall this reduced the number of vertices by a factor of 36 in the simplified terrain example I am using!

However, this appears to be the absolute limit on the number of blocks I can render. This already takes about 1 GB of RAM according to the task manager (although the vertices themselves are closer to half of this - GC and all).

Do I have to simplify my terrain and/or accept this limit, or is there a better way to do this? I previously tried using instancing but that slowed down after only 20,000 cubes or so.


  • \$\begingroup\$ Now that you have the chunks, you want to load and unload them based on their distance to the camera. Like a conveyor belt, unload them as they go out of range while loading the chunks coming into range. \$\endgroup\$ – MichaelHouse Apr 7 '13 at 5:06
  • \$\begingroup\$ 11 million cubes, what is your application? why so many voxels? I suppose not all voxels are used/visible at the same time, and there must be lots of them invisible at some instance. \$\endgroup\$ – David Apr 7 '13 at 10:33
  • \$\begingroup\$ Have a look at this answer which may help you reduce the number of vertices you are rendering. \$\endgroup\$ – Alex Apr 7 '13 at 11:46
  • \$\begingroup\$ Also here and here \$\endgroup\$ – MichaelHouse Apr 7 '13 at 15:46
  • \$\begingroup\$ 11mil cubes is 90mil vertexes, which at 16 bytes each is your 1.2GB amount. If you remove occluded vertices, or combine faces, you drop this figure gigantically. In a perfect, fully filled block, you would only ever need 8 vertices, or 128bytes. \$\endgroup\$ – Phil Apr 8 '13 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.