CubicVertex now uses a more memory efficient representation which can be decoded on the CPU or GPU.

This commit is contained in:
David Williams
2014-05-27 23:01:38 +02:00
parent 1790d8338f
commit 37ba9ab338
4 changed files with 11 additions and 9 deletions

View File

@ -81,11 +81,12 @@ int main(int argc, char *argv[])
auto mesh = extractCubicMesh(&volData, volData.getEnclosingRegion());
//auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion());
//auto mesh = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31)));
//auto mesh2 = extractCubicMesh(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63)));
// The surface extractor outputs the mesh in an efficient compressed format which is not directly suitable for rendering. The easiest approach is to
// decode this on the CPU as shown below, though more advanced applications can upload the compressed mesh to the GPU and decompress in shader code.
auto decodedMesh = decode(mesh);
//Pass the surface to the OpenGL window
openGLWidget.addMesh(mesh);
openGLWidget.addMesh(decodedMesh);
//openGLWidget.addMesh(mesh2);
openGLWidget.setViewableRegion(volData.getEnclosingRegion());