Memory improvements for surface extractor.

This commit is contained in:
David Williams
2010-10-20 22:14:03 +00:00
parent 695c15cecd
commit 0b410eaed3
2 changed files with 35 additions and 20 deletions

View File

@ -45,7 +45,7 @@ namespace PolyVox
void execute();
int32_t addVertex(float fX, float fY, float fZ, uint8_t uMaterial);
int32_t addVertex(float fX, float fY, float fZ, uint8_t uMaterial, Array<3, IndexAndMaterial>& existingVertices);
private:
//The volume data and a sampler to access it.
@ -59,7 +59,14 @@ namespace PolyVox
Region m_regSizeInVoxels;
Region m_regSizeInCells;
Array<4, IndexAndMaterial> m_vertices;
//Array<4, IndexAndMaterial> m_vertices;
Array<3, IndexAndMaterial> m_previousSliceVertices;
Array<3, IndexAndMaterial> m_currentSliceVertices;
//Although we try to avoid creating multiple vertices at the same location, sometimes this is unavoidable
//if they have different materials. For example, four different materials next to each other would mean
//four quads (though more triangles) sharing the vertex. As far as I can tell, four is the worst case scenario.
static const uint32_t MaxQuadsSharingVertex;
};
}