diff --git a/Cargo.toml b/Cargo.toml index 1a8a2e7..d98da31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_pipelines_ready" -version = "0.2.0" +version = "0.3.0" edition = "2021" license = "MIT OR Apache-2.0" description = "Bevy plugin for tracking render pipeline status." @@ -15,17 +15,15 @@ exclude = [".github"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.bevy] -version = "0.12" +version = "0.13" default-features = false -features = [ - "bevy_render" -] +features = ["bevy_render"] [dependencies] crossbeam-channel = "0.5.0" [dev-dependencies.bevy] -version = "0.12" +version = "0.13" default-features = false features = [ "android_shared_stdcxx", diff --git a/README.md b/README.md index d20d1e5..ab56684 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,23 @@ This is useful for creating a nice loading experience for your Bevy app, especia See [`examples/states.rs`](examples/states.rs). +## WebGL2 and WebGPU + +Install [wasm-server-runner](https://github.com/jakobhellermann/wasm-server-runner). + +```bash +# WebGL +cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgl2 + +# WebGPU +RUSTFLAGS=--cfg=web_sys_unstable_apis cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgpu +``` + ## Compatibility | `bevy_pipelines_ready` | `bevy` | | :-- | :-- | +| `0.3` | `0.13` | | `0.2` | `0.12` | | `0.1` | `0.11` | diff --git a/examples/states.rs b/examples/states.rs index 2c701d4..2ccbc72 100644 --- a/examples/states.rs +++ b/examples/states.rs @@ -18,19 +18,19 @@ const EXPECTED_PIPELINES: usize = 8; // The value will likely differ on the web due to different implementations of some // render features. #[cfg(target_arch = "wasm32")] -const EXPECTED_PIPELINES: usize = 5; +const EXPECTED_PIPELINES: usize = 6; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(PipelinesReadyPlugin) - .add_state::() + .init_state::() .add_systems(Startup, setup_loading_screen) .add_systems( Update, transition .run_if(in_state(GameState::Loading)) - .run_if(resource_changed::()), + .run_if(resource_changed::), ) .add_systems(OnExit(GameState::Loading), cleanup::) .run(); @@ -51,6 +51,7 @@ fn setup_loading_screen( commands.spawn(PointLightBundle { point_light: PointLight { shadows_enabled: true, + intensity: 48_000., ..default() }, transform: Transform::from_xyz(3.0, 6.0, 5.0), @@ -58,14 +59,14 @@ fn setup_loading_screen( }); commands.spawn(PbrBundle { - mesh: meshes.add(shape::Cylinder::default().into()), - material: materials.add(Color::PINK.into()), + mesh: meshes.add(Cylinder::default()), + material: materials.add(Color::PINK), ..default() }); commands.spawn(PbrBundle { - mesh: meshes.add(shape::Plane::from_size(10.0).into()), - material: materials.add(Color::rgb(0.4, 0.4, 0.4).into()), + mesh: meshes.add(Plane3d::default().mesh().size(10.0, 10.0)), + material: materials.add(Color::rgb(0.4, 0.4, 0.4)), transform: Transform::from_xyz(0., -0.5, 0.), ..default() });