use bevy::prelude::*; use bevy::render::render_resource::{AsBindGroup, ShaderRef}; pub struct ShadingPlugin; impl Plugin for ShadingPlugin { fn build(&self, app: &mut App) { app.add_plugins(MaterialPlugin::::default()); app.add_plugins(MaterialPlugin::::default()); } } #[derive(Asset, TypePath, AsBindGroup, Debug, Clone)] pub struct JupitersRing { pub alpha_mode: AlphaMode, #[uniform(0)] pub ring_radius: f32, #[uniform(1)] pub jupiter_radius: f32, } impl Material for JupitersRing { fn fragment_shader() -> ShaderRef { "shaders/jupiters_rings.wgsl".into() } fn alpha_mode(&self) -> AlphaMode { self.alpha_mode } } #[derive(Asset, TypePath, AsBindGroup, Debug, Clone)] pub struct AsteroidSurface { } impl Material for AsteroidSurface { fn fragment_shader() -> ShaderRef { "shaders/material_asteroid.wgsl".into() } }