Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jun 9, 2024
1 parent 2a684b7 commit 9e110fc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
25 changes: 19 additions & 6 deletions terrain/variable_lod/voxel_mesh_block_vlt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ VoxelMeshBlockVLT::~VoxelMeshBlockVLT() {
}
}

void VoxelMeshBlockVLT::set_mesh(Ref<Mesh> mesh, GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting, int render_layers_mask) {
void VoxelMeshBlockVLT::set_mesh(
Ref<Mesh> mesh,
GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting,
int render_layers_mask
) {
// TODO Don't add mesh instance to the world if it's not visible.
// I suspect Godot is trying to include invisible mesh instances into the culling process,
// which is killing performance when LOD is used (i.e many meshes are in pool but hidden)
Expand Down Expand Up @@ -140,8 +144,13 @@ void VoxelMeshBlockVLT::set_render_layers_mask(int mask) {
}
}

void VoxelMeshBlockVLT::set_transition_mesh(Ref<Mesh> mesh, unsigned int side, GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting, int render_layers_mask) {
void VoxelMeshBlockVLT::set_transition_mesh(
Ref<Mesh> mesh,
unsigned int side,
GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting,
int render_layers_mask
) {
DirectMeshInstance &mesh_instance = _transition_mesh_instances[side];

if (mesh.is_valid()) {
Expand Down Expand Up @@ -381,8 +390,12 @@ bool is_mesh_empty(Span<const VoxelMesher::Output::Surface> surfaces) {
return true;
}

Ref<ArrayMesh> build_mesh(Span<const VoxelMesher::Output::Surface> surfaces, Mesh::PrimitiveType primitive, int flags,
Ref<Material> material) {
Ref<ArrayMesh> build_mesh(
Span<const VoxelMesher::Output::Surface> surfaces,
Mesh::PrimitiveType primitive,
int flags,
Ref<Material> material
) {
ZN_PROFILE_SCOPE();
Ref<ArrayMesh> mesh;

Expand Down
25 changes: 19 additions & 6 deletions terrain/variable_lod/voxel_mesh_block_vlt.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ class VoxelMeshBlockVLT : public VoxelMeshBlock {

void set_parent_visible(bool parent_visible);

void set_mesh(Ref<Mesh> mesh, GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting, int render_layers_mask);
void set_mesh(
Ref<Mesh> mesh,
GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting,
int render_layers_mask
);
void drop_visuals();

void set_transition_mask(uint8_t m);
Expand All @@ -66,8 +70,13 @@ class VoxelMeshBlockVLT : public VoxelMeshBlock {
void set_shadow_casting(RenderingServer::ShadowCastingSetting mode);
void set_render_layers_mask(int mask);

void set_transition_mesh(Ref<Mesh> mesh, unsigned int side, GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting, int render_layers_mask);
void set_transition_mesh(
Ref<Mesh> mesh,
unsigned int side,
GeometryInstance3D::GIMode gi_mode,
RenderingServer::ShadowCastingSetting shadow_casting,
int render_layers_mask
);

void set_shader_material(Ref<ShaderMaterial> material);
inline Ref<ShaderMaterial> get_shader_material() const {
Expand Down Expand Up @@ -113,8 +122,12 @@ class VoxelMeshBlockVLT : public VoxelMeshBlock {

bool is_mesh_empty(Span<const VoxelMesher::Output::Surface> surfaces);

Ref<ArrayMesh> build_mesh(Span<const VoxelMesher::Output::Surface> surfaces, Mesh::PrimitiveType primitive, int flags,
Ref<Material> material);
Ref<ArrayMesh> build_mesh(
Span<const VoxelMesher::Output::Surface> surfaces,
Mesh::PrimitiveType primitive,
int flags,
Ref<Material> material
);

} // namespace zylann::voxel

Expand Down

0 comments on commit 9e110fc

Please sign in to comment.