tree dissolve + instances

This commit is contained in:
Jonas H
2026-03-05 15:06:29 +01:00
parent 350fddc2af
commit c37a9fd5dd
7 changed files with 124 additions and 83 deletions

View File

@@ -505,10 +505,23 @@ impl SnowLayer
})
});
let mut aabb_min = Vec3::splat(f32::MAX);
let mut aabb_max = Vec3::splat(f32::MIN);
for v in &vertices
{
let p = Vec3::from(v.position);
aabb_min = aabb_min.min(p);
aabb_max = aabb_max.max(p);
}
Mesh {
vertex_buffer,
index_buffer,
num_indices: indices.len() as u32,
aabb_min,
aabb_max,
cpu_positions: Vec::new(),
cpu_indices: Vec::new(),
}
}
@@ -568,6 +581,7 @@ impl SnowLayer
enable_dissolve: false,
enable_snow_light: true,
displacement_bind_group: Some(self.displacement_bind_group.clone()),
entity: None,
})
.collect()
}