diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 892b8004..55eef19e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -103,6 +103,14 @@ namespace PolyVox return 1; } + /** + * Returns a material which is in some sense a weighted combination of the supplied materials. + * + * The Marching Cubes algotithm generates vertices which lie between voxels, and ideally the material of the vertex should be interpolated from the materials + * of the voxels. In practice, that material type is often an integer identifier (e.g. 1 = rock, 2 = soil, 3 = grass) and an interpolation doean't make sense + * (e.g. soil is not a combination or rock and grass). Therefore this default interpolation just return one material or the other, but if more advanced voxel + * types do support interpolation then it can be implemented in this function. + */ MaterialType blendMaterials(MaterialType a, MaterialType b, float weight) { if(weight < 0.5f)