diff --git a/Cargo.lock b/Cargo.lock index fd36472..6cfc93c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -434,6 +434,51 @@ dependencies = [ "bevy_internal", ] +[[package]] +name = "bevy-inspector-egui" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4971e763f289921fd4616418628458bec26a6fc13fe4299c0e4066f39d7ceaa2" +dependencies = [ + "bevy-inspector-egui-derive", + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_egui", + "bevy_image", + "bevy_log", + "bevy_math", + "bevy_pbr", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_state", + "bevy_time", + "bevy_utils", + "bevy_window", + "bytemuck", + "disqualified", + "egui", + "fuzzy-matcher", + "image", + "smallvec", + "uuid", + "winit", +] + +[[package]] +name = "bevy-inspector-egui-derive" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2656316165dbe2af6b3acaa763332f5dbdd12f809d59f5bf4304e0642a8005c9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "bevy_a11y" version = "0.16.0" @@ -1481,6 +1526,7 @@ name = "bevyart" version = "0.1.0" dependencies = [ "bevy", + "bevy-inspector-egui", "bevy_egui", "bevy_panorbit_camera", ] @@ -2518,6 +2564,15 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "fuzzy-matcher" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" +dependencies = [ + "thread_local", +] + [[package]] name = "generic-array" version = "0.14.7" diff --git a/Cargo.toml b/Cargo.toml index 6d688f6..234279c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0" [dependencies] bevy = { version = "0.16.0", features = ["shader_format_wesl"] } +bevy-inspector-egui = "0.31.0" bevy_egui = "0.34.1" bevy_panorbit_camera = { version = "0.26.0", features = ["bevy_egui"] } diff --git a/src/main.rs b/src/main.rs index 2041992..dcd63eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use bevy::{color::palettes::css::RED, prelude::*, render::storage::ShaderStorageBuffer}; use bevy_egui::EguiPlugin; +use bevy_inspector_egui::quick::WorldInspectorPlugin; use mandelbulb::{MandelbulbExtension, MandelbulbMaterial, MandelbulbStorage}; mod camera; @@ -12,6 +13,7 @@ fn main() { EguiPlugin { enable_multipass_for_primary_context: false, }, + WorldInspectorPlugin::new(), )) .add_plugins((camera::plugin, mandelbulb::plugin)) .add_systems(Startup, setup) diff --git a/src/mandelbulb.rs b/src/mandelbulb.rs index 29b3293..f45c967 100644 --- a/src/mandelbulb.rs +++ b/src/mandelbulb.rs @@ -6,6 +6,7 @@ use bevy::{ storage::ShaderStorageBuffer, }, }; +use bevy_inspector_egui::quick::ResourceInspectorPlugin; pub type MandelbulbMaterial = ExtendedMaterial; @@ -14,10 +15,12 @@ const SHADER_ASSET_PATH: &str = "shaders/mandelbulb.wgsl"; pub fn plugin(app: &mut App) { app.add_plugins(MaterialPlugin::::default()) .init_resource::() + .register_type::() + .add_plugins(ResourceInspectorPlugin::::new()) .add_systems(Update, update_volu_material); } -#[derive(Resource)] +#[derive(Resource, Debug, Reflect)] struct MandelbulbSettings { power: f32, iterations: i32,