0
\$\begingroup\$

i just did the tutorial on Hardware Instancing from this source: http://www.float4x4.net/index.php/2011/07/hardware-instancing-for-pc-in-xna-4-with-textures/. Somewhere between 900.000 and 1.000.000 draw calls for the cube i get this error "XNA Framework HiDef profile supports a maximum VertexBuffer size of 67108863." while still running smoothly on 900k. That is slightly less then 100x100x100 which are a exactly a million.

Now i have seen voxel engines with very "tiny" voxels, you easily get to 1.000.000 cubes in view with rough terrain and a decent far plane. Obviously i can optimize a lot in the geometry buffer method, like rendering only visible faces of a cube or using larger faces covering multiple cubes if the area is flat. But is a vertex buffer of roughly 67mb the max i can work with or can i create multiple?

\$\endgroup\$
  • \$\begingroup\$ What I'm writing is properly very stupid, but I normally use the Vertex-Buffer to store one singe cube and draw it multiple times. So In my Vertex-Buffer, there are only 8 vertices and in my index-buffer 36. But your method may be faster. I haven't got enough experience to say that. Your said you have seen very tiny voxel engines, but they aren't written in XNA and not in managed code, so they will run much faster even if they draw more vertices. \$\endgroup\$ – jalgames Sep 28 '13 at 9:03
  • 3
    \$\begingroup\$ Most voxel engines don't use hardware instancing. They create meshes for chunks of terrain, each chunk being fewer than the maximum vertex limit and the number of chunks being less than the maximum draw call. \$\endgroup\$ – MichaelHouse Sep 28 '13 at 14:55
  • 3
    \$\begingroup\$ And most voxel engines with "tiny voxels" (as you describe) have probably some kind of level of detail system, so that the furthest chunks won't even nearly take the same amount of vertices as the closer ones. Just something to consider. \$\endgroup\$ – user9790 Sep 28 '13 at 17:05
1
\$\begingroup\$

If all else fails you can do multiple render passes, with voxels I suppose splitting the screen into squares and rendering each of those separately will work reasonably.

Also, please consider what you are trying to achieve. Voxel engines are mostly unsuitable for games, they are hard to work with and hard to get good performance from.

If you want to make a game, stay away from voxels. If you want to play around with voxels that is fine, but don't expect to make anything better than some silly tech demo.

\$\endgroup\$
  • 2
    \$\begingroup\$ So Minecraft, Cube World, Miner Wars, and countless other recent games are all silly tech demos? \$\endgroup\$ – Dave Carlile Oct 29 '13 at 18:14
  • 2
    \$\begingroup\$ No, but they are special cases. This answer is correct for the general case of a voxel engine used for a game, but special cases will always exist. \$\endgroup\$ – Maximus Minimus Oct 29 '13 at 18:56
  • 1
    \$\begingroup\$ @CrappyCodingGuy Minecraft does not use voxels, it uses textured blocks. Cube World has clearly visible blocks, so it is not really what you would normally consider a voxel engine either. Miner Wars seem to be true to the voxel idea, too bad it is not a very good game, perhaps someone spent a bit too many resources on the technical side of the production, overlooking that the efforts did nothing to further the gameplay. \$\endgroup\$ – aaaaaaaaaaaa Nov 7 '13 at 20:50
  • 3
    \$\begingroup\$ Voxel engines being "hard to work with" and "silly tech demos" is inappropriate, overly subjective, and broad. The asker didn't ask whether making a voxel engine is a good idea or not. \$\endgroup\$ – Philip Jan 3 '14 at 4:13
  • \$\begingroup\$ @Philip I answered the question to the best of my knowledge, and then I provided some additional information that I thought might be relevant in the context. Read the question and assess the skill level of the asker, I see someone who didn't manage to make a single optimization on his own, and thought XNA was a good place to start out when making a voxel engine. Do you really think he'll pull through to make a reasonable voxel engine? I very much doubt it, but he might still be able to make a game if he doesn't drown himself in ambitious technical details. \$\endgroup\$ – aaaaaaaaaaaa Jan 4 '14 at 9:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.