mirror of
https://github.com/Relintai/godot_voxel.git
synced 2025-05-01 17:57:55 +02:00
Don't parse smooth voxels if the buffer is uniform
This commit is contained in:
parent
6419e78fc2
commit
40dcf89f57
@ -129,6 +129,11 @@ void VoxelMesherSmooth::build_mesh(const VoxelBuffer &voxels, unsigned int chann
|
|||||||
|
|
||||||
// Each 2x2 voxel group is a "cell"
|
// 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();
|
const Vector3i block_size = voxels.get_size();
|
||||||
// TODO No lod yet, but it's planned
|
// TODO No lod yet, but it's planned
|
||||||
const int lod_index = 0;
|
const int lod_index = 0;
|
||||||
|
@ -102,6 +102,7 @@ void VoxelTerrain::set_view_distance(int distance_in_voxels) {
|
|||||||
_view_distance_blocks = d;
|
_view_distance_blocks = d;
|
||||||
make_all_view_dirty();
|
make_all_view_dirty();
|
||||||
// TODO Immerge blocks too far away
|
// 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);
|
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("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);
|
ClassDB::bind_method(D_METHOD("block_to_voxel", "block_pos"), &VoxelTerrain::_block_to_voxel_binding);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user