1
\$\begingroup\$

I'm working on a 3D game with large blocky untextured, but individually colored, voxels (similar to CubeWorld). For rendering, right now I naively convert online all visible faces ahead of time to triangles with the color information stored in the vertex attributes. The screenshot below is an example of what I'm currently doing. There's a lot of room to improve here and I want to switch to a system that uses fewer vertices and stores color information in a texture.

Screenshot with a wireframe cutaway

What I'd like to do is combine adjacent triangles with the same normals and simplify the mesh so I'm left with a fraction of the vertices. My big hangup is color information. It's easy to add UVs, but the correct choice for texturing isn't obvious. I'm trying to figure out the relative performance of these options:

  1. Use a 1D texture. This is compact but I'm concerned that large 1D textures won't play nicely with texture mapping units optimized for 2D textures.
  2. Use a 2D texture. Simple, but it'll end up with gaps.
  3. Use a 3D texture with the full set of voxels.

Does anyone have insight as to the relative performance of these options? No mipmapping or other filtering is needed here, so all three options should be viable.

For reference I'm making this in C++ using OpenGL on Windows. My target GPU architectures are GTX 780 Ti and higher or AMD equivalent.

\$\endgroup\$

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.