mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-19 02:47:18 +01: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"
|
||||
|
||||
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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user