Don't parse smooth voxels if the buffer is uniform

This commit is contained in:
Marc Gilleron 2017-08-20 19:15:36 +02:00
parent 6419e78fc2
commit 40dcf89f57
2 changed files with 6 additions and 1 deletions

View File

@ -129,6 +129,11 @@ void VoxelMesherSmooth::build_mesh(const VoxelBuffer &voxels, unsigned int chann
// Each 2x2 voxel group is a "cell"
if(voxels.is_uniform(channel)) {
// Nothing to extract, because constant isolevels never cross the surface
return;
}
const Vector3i block_size = voxels.get_size();
// TODO No lod yet, but it's planned
const int lod_index = 0;

View File

@ -102,6 +102,7 @@ void VoxelTerrain::set_view_distance(int distance_in_voxels) {
_view_distance_blocks = d;
make_all_view_dirty();
// TODO Immerge blocks too far away
// TODO Cancel updates that are scheduled too far away
}
}
@ -545,7 +546,6 @@ void VoxelTerrain::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_storage"), &VoxelTerrain::get_map);
// TODO Make those two static in VoxelMap?
ClassDB::bind_method(D_METHOD("voxel_to_block", "voxel_pos"), &VoxelTerrain::_voxel_to_block_binding);
ClassDB::bind_method(D_METHOD("block_to_voxel", "block_pos"), &VoxelTerrain::_block_to_voxel_binding);