mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
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
This commit is contained in:
parent
cf7d810980
commit
ea283c1dea
1 changed files with 8 additions and 2 deletions
|
@ -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::<VolumetricFogSettings>()
|
||||
.register_type::<VolumetricLight>();
|
||||
|
||||
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue