From 7c28ad65a6837f66895b6875428ac244c0c6dd77 Mon Sep 17 00:00:00 2001 From: "Spencer C. Imbleau" Date: Sun, 4 Aug 2024 12:21:01 -0400 Subject: [PATCH 1/8] refactor: cleanup --- CHANGELOG.md | 2 + examples/cube3d/src/main.rs | 20 +++++++-- examples/render_layers/src/main.rs | 48 ++++++---------------- src/lib.rs | 18 +-------- src/plugin.rs | 49 +++++++++++++++++----- src/render/mod.rs | 39 ++++++++++++++++-- src/render/plugin.rs | 65 +++++++++++++++--------------- src/render/systems.rs | 37 ++++++----------- 8 files changed, 150 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48b02c8..e8a9dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe - There is now a `default_font` feature that uses the same `FiraMono-subset.ttf` font used in the bevy/default_font feature. - There is now a `render_layers` example. - There is now a `cube_3d` example. +- Added `VelloRenderer::from_device` to create a renderer manually. ### Changed @@ -32,6 +33,7 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe ### Removed - Removed `ZFunction`s from the render pipeline. Now ordering is based solely on the `Transform`'s z component. If you dependeded on this behavior, you'll need to adjust the transform Z in a system prior to render. +- Removed `VelloCanvasMaterial` from prelude, as it's not typically meant to be used under normal circumstances and could be a common footgun. ### Fixed diff --git a/examples/cube3d/src/main.rs b/examples/cube3d/src/main.rs index 11cf294..fceccb4 100644 --- a/examples/cube3d/src/main.rs +++ b/examples/cube3d/src/main.rs @@ -11,7 +11,11 @@ use bevy::{ Render, RenderApp, RenderSet, }, }; -use bevy_vello::{prelude::*, render::VelloRenderer, VelloPlugin}; +use bevy_vello::{ + prelude::*, + render::{VelloRenderPlugin, VelloRenderer}, + VelloPlugin, +}; #[derive(Component)] pub struct VelloTarget(Handle); @@ -33,7 +37,7 @@ fn main() { let mut app = App::new(); app.add_plugins(DefaultPlugins) - .add_plugins(VelloPlugin::default()) + .add_plugins(VelloRenderPlugin::default()) .add_systems(Startup, setup) .add_systems(Update, cube_rotator_system) .add_plugins(ExtractComponentPlugin::::default()); @@ -122,8 +126,16 @@ fn render_texture( queue: Res, time: Res