I am rendering a point-cloud using Bevy, but currently spawning a icoshpere for each point, which gets quite slow with 775k points. What is the easiest way to use mesh instancing to reduce overhead?
This is the code for how I am doing it currently:
for point in &pointcloud_assets.get(&pointcloud.church).unwrap().points {
commands
.spawn_bundle(PbrBundle{
mesh: sphere.clone(),
material: material.clone(),
transform: Transform::from_translation(*point / 10.),
..Default::default()
});
}
I found this example: https://bevyengine.org/examples/shader/shader-instancing/ but it is called shader-instancing, and I am not sure if it is the same thing. It also seems quite complex, so I was wondering if there wasn't a simpler solution.