From ea283c1dead8a1b3d6929d1e9d2d2bdddaa93e05 Mon Sep 17 00:00:00 2001 From: IceSentry Date: Fri, 31 May 2024 06:20:15 -0400 Subject: [PATCH] Add some missing reflect for volumetric fog types (#13592) # Objective - While experimenting with it I realized it's not reflectable ## Solution - Add missing Reflect derive --- crates/bevy_pbr/src/volumetric_fog/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/bevy_pbr/src/volumetric_fog/mod.rs b/crates/bevy_pbr/src/volumetric_fog/mod.rs index 2a1afdb338..acc3b303c7 100644 --- a/crates/bevy_pbr/src/volumetric_fog/mod.rs +++ b/crates/bevy_pbr/src/volumetric_fog/mod.rs @@ -45,11 +45,13 @@ use bevy_ecs::{ component::Component, entity::Entity, query::{Has, QueryItem, With}, + reflect::ReflectComponent, schedule::IntoSystemConfigs as _, system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; use bevy_math::Vec3; +use bevy_reflect::Reflect; use bevy_render::{ render_graph::{NodeRunError, RenderGraphApp, RenderGraphContext, ViewNode, ViewNodeRunner}, render_resource::{ @@ -86,12 +88,14 @@ pub struct VolumetricFogPlugin; /// (`shadows_enabled: true`) to make volumetric fog interact with it. /// /// This allows the light to generate light shafts/god rays. -#[derive(Clone, Copy, Component, Default, Debug)] +#[derive(Clone, Copy, Component, Default, Debug, Reflect)] +#[reflect(Component)] pub struct VolumetricLight; /// When placed on a [`Camera3d`], enables volumetric fog and volumetric /// lighting, also known as light shafts or god rays. -#[derive(Clone, Copy, Component, Debug)] +#[derive(Clone, Copy, Component, Debug, Reflect)] +#[reflect(Component)] pub struct VolumetricFogSettings { /// The color of the fog. /// @@ -246,6 +250,8 @@ impl Plugin for VolumetricFogPlugin { "volumetric_fog.wgsl", Shader::from_wgsl ); + app.register_type::() + .register_type::(); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return;