This example is running in WebGL2 and should work in most browsers. You can check the WebGPU examples here.
//! Simple benchmark to test per-entity draw overhead. //! //! To measure performance realistically, be sure to run this in release mode. //! `cargo run --example many_cubes --release` //! //! By default, this arranges the meshes in a cubical pattern, where the number of visible meshes //! varies with the viewing angle. You can choose to run the demo with a spherical pattern that //! distributes the meshes evenly. //! //! To start the demo using the spherical layout run //! `cargo run --example many_cubes --release sphere` use PI; use ; // NOTE: This epsilon value is apparently optimal for optimizing for the average // nearest-neighbor distance. See: // http://extremelearning.com.au/how-to-evenly-distribute-points-on-a-sphere-more-effectively-than-the-canonical-fibonacci-lattice/ // for details. const EPSILON: f64 = 0.36; // System for rotating the camera // System for printing the number of meshes on every tick of the timer ;