diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b707af..f18a6a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,72 +5,78 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Setup | Checkout - uses: actions/checkout@v4 + - name: Setup | Checkout + uses: actions/checkout@v4 - - name: Setup | Ubuntu dependencies - run: sudo apt install libasound2-dev libudev-dev pkg-config + - name: Setup | Ubuntu dependencies + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Setup | Toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: clippy,rustfmt + - name: Setup | Toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy,rustfmt - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - - name: Build | Clippy - run: cargo clippy -- -D warnings + - name: Build | Clippy + run: cargo clippy -- -D warnings - - name: Build | Rustfmt - run: cargo fmt -- --check + - name: Build | Rustfmt + run: cargo fmt -- --check check: runs-on: ubuntu-latest steps: - - name: Setup | Checkout - uses: actions/checkout@v4 + - name: Setup | Checkout + uses: actions/checkout@v4 - - name: Setup | Ubuntu dependencies - run: sudo apt install libasound2-dev libudev-dev pkg-config + - name: Setup | Ubuntu dependencies + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Setup | Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown + - name: Setup | Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - - name: Build | Check (native) - run: cargo check + - name: Build | Check (native) + run: cargo check - - name: Build | Check (wasm) - run: cargo check --target wasm32-unknown-unknown + - name: Build | Check (wasm) + run: cargo check --target wasm32-unknown-unknown test: needs: [check] runs-on: ubuntu-latest steps: - - name: Setup | Checkout - uses: actions/checkout@v4 + - name: Setup | Checkout + uses: actions/checkout@v4 - - name: Setup | Ubuntu dependencies - run: sudo apt install libasound2-dev libudev-dev pkg-config + - name: Setup | Ubuntu dependencies + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Setup | Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown + - name: Setup | Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown - - name: Setup | wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 + - name: Setup | wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 - - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.3 + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 - - name: Build | Test (native) - run: cargo test + - name: Build | Test (native) + run: cargo test - - name: Build | Test (wasm) - run: wasm-pack test --node \ No newline at end of file + - name: Build | Test (wasm) + run: wasm-pack test --node diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d536a4..d7da5dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ You can find its changes [documented below](#061---2024-08-14). This release supports Bevy version 0.14 and has an [MSRV][] of 1.80. +### Changed + +- bevy_vello now uses Bevy 0.15 + ## [0.6.1] - 2024-08-14 This release supports Bevy version 0.14 and has an [MSRV][] of 1.80. diff --git a/Cargo.toml b/Cargo.toml index 94b695c..9f4134b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,9 +20,10 @@ license = "(MIT OR Apache-2.0) AND OFL-1.1" repository = "https://github.com/linebender/bevy_vello" [workspace.dependencies] -bevy = { version = "0.14.0", default-features = false, features = [ +bevy = { version = "0.15.1", default-features = false, features = [ "bevy_asset", "bevy_winit", + "bevy_window", "bevy_core_pipeline", "bevy_pbr", "bevy_render", @@ -51,14 +52,16 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] bevy = { workspace = true } -vello = "0.2.1" -vello_svg = "0.3.0" -velato = "0.3.0" -thiserror = "1.0.61" +vello = "0.4.0" +vello_svg = "0.6.0" +velato = "0.5.0" +thiserror = "2.0.11" once_cell = "1.19.0" +skrifa = "0.26.5" +bytemuck = { version = "1.21.0", features = ["derive"] } [dev-dependencies] -wasm-bindgen-test = "0.3.42" +wasm-bindgen-test = "0.3.50" [features] default = ["default_font"] diff --git a/README.md b/README.md index 6127d7f..adf2e11 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ cargo run -p demo |bevy|bevy_vello| |---|---| -|0.14|0.5-0.6, main| +|0.15|main| +|0.14|0.5-0.6| |0.13|0.1-0.4| |< 0.13| unsupported | diff --git a/examples/cube3d/src/main.rs b/examples/cube3d/src/main.rs index 60ad858..191fcb0 100644 --- a/examples/cube3d/src/main.rs +++ b/examples/cube3d/src/main.rs @@ -97,24 +97,21 @@ fn setup( }); // Main pass cube, with material containing the rendered first pass texture. commands.spawn(( - PbrBundle { - mesh: meshes.add(Cuboid::new(4.0, 4.0, 4.0)), - material: material_handle, - transform: Transform::from_xyz(0.0, 0.0, 1.5) - .with_rotation(Quat::from_rotation_x(-std::f32::consts::PI / 5.0)), - ..default() - }, + Mesh3d(meshes.add(Cuboid::new(4.0, 4.0, 4.0))), + MeshMaterial3d(material_handle), + Transform::from_xyz(0.0, 0.0, 1.5) + .with_rotation(Quat::from_rotation_x(-std::f32::consts::PI / 5.0)), MainPassCube, )); // The main pass camera. - commands.spawn(PointLightBundle { - transform: Transform::from_translation(Vec3::new(0.0, 0.0, 10.0)), - ..default() - }); - commands.spawn(Camera3dBundle { - transform: Transform::from_xyz(0.0, 0.0, 15.0).looking_at(Vec3::ZERO, Vec3::Y), - ..default() - }); + commands + .spawn(PointLight::default()) + .insert(Transform::from_translation(Vec3::new(0.0, 0.0, 10.0))); + + commands + .spawn(Camera3d::default()) + .insert(Transform::from_xyz(0.0, 0.0, 15.0).looking_at(Vec3::ZERO, Vec3::Y)); + commands.spawn(VelloTarget(image_handle)); } @@ -131,7 +128,7 @@ fn render_texture( let mut scene = VelloScene::default(); // Animate the scene - let sin_time = time.elapsed_seconds().sin().mul_add(0.5, 0.5); + let sin_time = time.elapsed_secs().sin().mul_add(0.5, 0.5); let c = Vec3::lerp( Vec3::new(-1.0, 0.0, 1.0), Vec3::new(1.0, 0.0, 1.0), @@ -140,7 +137,7 @@ fn render_texture( scene.fill( peniko::Fill::NonZero, kurbo::Affine::translate((128.0, 128.0)), - peniko::Color::rgb(c.x as f64, c.y as f64, c.z as f64), + peniko::Color::new([c.x, c.y, c.z, 1.]), None, &kurbo::RoundedRect::new(0.0, 0.0, 256.0, 256.0, (sin_time as f64) * 128.0), ); @@ -168,7 +165,7 @@ fn render_texture( /// Rotates the outer cube (main pass) fn cube_rotator_system(time: Res