diff --git a/crates/bevy_pbr/src/bundle.rs b/crates/bevy_pbr/src/bundle.rs index e1147a46e4..52c7c64384 100644 --- a/crates/bevy_pbr/src/bundle.rs +++ b/crates/bevy_pbr/src/bundle.rs @@ -6,6 +6,7 @@ use bevy_asset::Handle; use bevy_derive::{Deref, DerefMut}; use bevy_ecs::entity::{Entity, EntityHashMap}; use bevy_ecs::{bundle::Bundle, component::Component, reflect::ReflectComponent}; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use bevy_render::{ mesh::Mesh, @@ -50,14 +51,14 @@ impl Default for MaterialMeshBundle { /// This component contains all mesh entities visible from the current light view. /// The collection is updated automatically by [`crate::SimulationLightSystems`]. #[derive(Component, Clone, Debug, Default, Reflect, Deref, DerefMut)] -#[reflect(Component)] +#[reflect(Component, Debug, Default)] pub struct VisibleMeshEntities { #[reflect(ignore)] pub entities: Vec, } #[derive(Component, Clone, Debug, Default, Reflect)] -#[reflect(Component)] +#[reflect(Component, Debug, Default)] pub struct CubemapVisibleEntities { #[reflect(ignore)] data: [VisibleMeshEntities; 6], diff --git a/crates/bevy_pbr/src/cluster/mod.rs b/crates/bevy_pbr/src/cluster/mod.rs index 5ebb19dc3d..7771e95ba3 100644 --- a/crates/bevy_pbr/src/cluster/mod.rs +++ b/crates/bevy_pbr/src/cluster/mod.rs @@ -80,7 +80,7 @@ pub struct ClusterZConfig { /// Configuration of the clustering strategy for clustered forward rendering #[derive(Debug, Copy, Clone, Component, Reflect)] -#[reflect(Component)] +#[reflect(Component, Debug, Default)] pub enum ClusterConfig { /// Disable cluster calculations for this view None, diff --git a/crates/bevy_pbr/src/fog.rs b/crates/bevy_pbr/src/fog.rs index 7db237aa9c..10682e09be 100644 --- a/crates/bevy_pbr/src/fog.rs +++ b/crates/bevy_pbr/src/fog.rs @@ -50,7 +50,7 @@ use bevy_render::{extract_component::ExtractComponent, prelude::Camera}; /// [`StandardMaterial`](crate::StandardMaterial) instances via the `fog_enabled` flag. #[derive(Debug, Clone, Component, Reflect, ExtractComponent)] #[extract_component_filter(With)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct DistanceFog { /// The color of the fog effect. /// diff --git a/crates/bevy_pbr/src/light/ambient_light.rs b/crates/bevy_pbr/src/light/ambient_light.rs index 9bff67d5f8..9c42eea516 100644 --- a/crates/bevy_pbr/src/light/ambient_light.rs +++ b/crates/bevy_pbr/src/light/ambient_light.rs @@ -16,7 +16,7 @@ use super::*; /// } /// ``` #[derive(Resource, Clone, Debug, ExtractResource, Reflect)] -#[reflect(Resource)] +#[reflect(Resource, Debug, Default)] pub struct AmbientLight { pub color: Color, /// A direct scale factor multiplied with `color` before being passed to the shader. diff --git a/crates/bevy_pbr/src/light/directional_light.rs b/crates/bevy_pbr/src/light/directional_light.rs index 9c74971ca1..9ae1f69927 100644 --- a/crates/bevy_pbr/src/light/directional_light.rs +++ b/crates/bevy_pbr/src/light/directional_light.rs @@ -48,7 +48,7 @@ use super::*; /// .insert_resource(DirectionalLightShadowMap { size: 2048 }); /// ``` #[derive(Component, Debug, Clone, Reflect)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct DirectionalLight { pub color: Color, /// Illuminance in lux (lumens per square meter), representing the amount of diff --git a/crates/bevy_pbr/src/light/mod.rs b/crates/bevy_pbr/src/light/mod.rs index 7de24c347c..ab9410254b 100644 --- a/crates/bevy_pbr/src/light/mod.rs +++ b/crates/bevy_pbr/src/light/mod.rs @@ -88,7 +88,7 @@ pub mod light_consts { } #[derive(Resource, Clone, Debug, Reflect)] -#[reflect(Resource)] +#[reflect(Resource, Debug, Default)] pub struct PointLightShadowMap { pub size: usize, } @@ -105,7 +105,7 @@ pub type WithLight = Or<(With, With, With, @@ -271,7 +271,7 @@ impl From for CascadeShadowConfig { } #[derive(Component, Clone, Debug, Default, Reflect)] -#[reflect(Component)] +#[reflect(Component, Debug, Default)] pub struct Cascades { /// Map from a view to the configuration of each of its [`Cascade`]s. pub(crate) cascades: EntityHashMap>, @@ -439,7 +439,7 @@ fn calculate_cascade( } /// Add this component to make a [`Mesh`] not cast shadows. #[derive(Debug, Component, Reflect, Default)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct NotShadowCaster; /// Add this component to make a [`Mesh`] not receive shadows. /// @@ -447,7 +447,7 @@ pub struct NotShadowCaster; /// cause both “regular” shadows as well as diffusely transmitted shadows to be disabled, /// even when [`TransmittedShadowReceiver`] is being used. #[derive(Debug, Component, Reflect, Default)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct NotShadowReceiver; /// Add this component to make a [`Mesh`] using a PBR material with [`diffuse_transmission`](crate::pbr_material::StandardMaterial::diffuse_transmission)`> 0.0` /// receive shadows on its diffuse transmission lobe. (i.e. its “backside”) @@ -457,7 +457,7 @@ pub struct NotShadowReceiver; /// /// **Note:** Using [`NotShadowReceiver`] overrides this component. #[derive(Debug, Component, Reflect, Default)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct TransmittedShadowReceiver; /// Add this component to a [`Camera3d`](bevy_core_pipeline::core_3d::Camera3d) @@ -466,7 +466,7 @@ pub struct TransmittedShadowReceiver; /// The different modes use different approaches to /// [Percentage Closer Filtering](https://developer.nvidia.com/gpugems/gpugems/part-ii-lighting-and-shadows/chapter-11-shadow-map-antialiasing). #[derive(Debug, Component, ExtractComponent, Reflect, Clone, Copy, PartialEq, Eq, Default)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug, PartialEq)] pub enum ShadowFilteringMethod { /// Hardware 2x2. /// diff --git a/crates/bevy_pbr/src/light/point_light.rs b/crates/bevy_pbr/src/light/point_light.rs index 9ca85cd4db..5baa7f66f6 100644 --- a/crates/bevy_pbr/src/light/point_light.rs +++ b/crates/bevy_pbr/src/light/point_light.rs @@ -18,7 +18,7 @@ use super::*; /// /// Source: [Wikipedia](https://en.wikipedia.org/wiki/Lumen_(unit)#Lighting) #[derive(Component, Debug, Clone, Copy, Reflect)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct PointLight { /// The color of this light source. pub color: Color, diff --git a/crates/bevy_pbr/src/light/spot_light.rs b/crates/bevy_pbr/src/light/spot_light.rs index ab34196ff0..621ee70f14 100644 --- a/crates/bevy_pbr/src/light/spot_light.rs +++ b/crates/bevy_pbr/src/light/spot_light.rs @@ -5,7 +5,7 @@ use super::*; /// shines light only in a given direction. The direction is taken from /// the transform, and can be specified with [`Transform::looking_at`](Transform::looking_at). #[derive(Component, Debug, Clone, Copy, Reflect)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct SpotLight { pub color: Color, /// Luminous power in lumens, representing the amount of light emitted by this source in all directions. diff --git a/crates/bevy_pbr/src/light_probe/environment_map.rs b/crates/bevy_pbr/src/light_probe/environment_map.rs index 1b1604df4d..a9be284fba 100644 --- a/crates/bevy_pbr/src/light_probe/environment_map.rs +++ b/crates/bevy_pbr/src/light_probe/environment_map.rs @@ -48,9 +48,11 @@ use bevy_asset::{AssetId, Handle}; use bevy_ecs::{ - bundle::Bundle, component::Component, query::QueryItem, system::lifetimeless::Read, + bundle::Bundle, component::Component, query::QueryItem, reflect::ReflectComponent, + system::lifetimeless::Read, }; use bevy_math::Quat; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use bevy_render::{ extract_instances::ExtractInstance, @@ -84,6 +86,7 @@ pub const ENVIRONMENT_MAP_SHADER_HANDLE: Handle = /// /// See [`crate::environment_map`] for detailed information. #[derive(Clone, Component, Reflect)] +#[reflect(Component, Default)] pub struct EnvironmentMapLight { /// The blurry image that represents diffuse radiance surrounding a region. pub diffuse_map: Handle, diff --git a/crates/bevy_pbr/src/light_probe/irradiance_volume.rs b/crates/bevy_pbr/src/light_probe/irradiance_volume.rs index 58110e98af..34f9f902a6 100644 --- a/crates/bevy_pbr/src/light_probe/irradiance_volume.rs +++ b/crates/bevy_pbr/src/light_probe/irradiance_volume.rs @@ -132,7 +132,7 @@ //! //! [Why ambient cubes?]: #why-ambient-cubes -use bevy_ecs::component::Component; +use bevy_ecs::{component::Component, reflect::ReflectComponent}; use bevy_render::{ render_asset::RenderAssets, render_resource::{ @@ -145,6 +145,7 @@ use bevy_render::{ use std::{num::NonZero, ops::Deref}; use bevy_asset::{AssetId, Handle}; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use crate::{ @@ -166,6 +167,7 @@ pub(crate) const IRRADIANCE_VOLUMES_ARE_USABLE: bool = cfg!(not(target_arch = "w /// /// See [`crate::irradiance_volume`] for detailed information. #[derive(Clone, Default, Reflect, Component, Debug)] +#[reflect(Component, Default, Debug)] pub struct IrradianceVolume { /// The 3D texture that represents the ambient cubes, encoded in the format /// described in [`crate::irradiance_volume`]. diff --git a/crates/bevy_pbr/src/light_probe/mod.rs b/crates/bevy_pbr/src/light_probe/mod.rs index dbcdd680d9..7d84a28b19 100644 --- a/crates/bevy_pbr/src/light_probe/mod.rs +++ b/crates/bevy_pbr/src/light_probe/mod.rs @@ -103,7 +103,7 @@ pub struct LightProbePlugin; /// specific technique but rather to a class of techniques. Developers familiar /// with other engines should be aware of this terminology difference. #[derive(Component, Debug, Clone, Copy, Default, Reflect)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct LightProbe; /// A GPU type that stores information about a light probe. diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index ac072afffd..8bf6ae254d 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -20,6 +20,7 @@ use bevy_ecs::{ prelude::*, system::{lifetimeless::SRes, SystemParamItem}, }; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use bevy_render::{ camera::TemporalJitter, @@ -825,6 +826,7 @@ pub fn queue_material_meshes( /// Default render method used for opaque materials. #[derive(Default, Resource, Clone, Debug, ExtractResource, Reflect)] +#[reflect(Resource, Default, Debug)] pub struct DefaultOpaqueRendererMethod(OpaqueRendererMethod); impl DefaultOpaqueRendererMethod { diff --git a/crates/bevy_pbr/src/ssao/mod.rs b/crates/bevy_pbr/src/ssao/mod.rs index 02a81b014d..249a2267b7 100644 --- a/crates/bevy_pbr/src/ssao/mod.rs +++ b/crates/bevy_pbr/src/ssao/mod.rs @@ -14,6 +14,7 @@ use bevy_ecs::{ system::{Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use bevy_render::{ camera::{ExtractedCamera, TemporalJitter}, @@ -154,7 +155,7 @@ pub struct ScreenSpaceAmbientOcclusionBundle { /// /// SSAO is not supported on `WebGL2`, and is not currently supported on `WebGPU` or `DirectX12`. #[derive(Component, ExtractComponent, Reflect, PartialEq, Eq, Hash, Clone, Default, Debug)] -#[reflect(Component)] +#[reflect(Component, Debug, Default, Hash, PartialEq)] #[doc(alias = "Ssao")] pub struct ScreenSpaceAmbientOcclusion { pub quality_level: ScreenSpaceAmbientOcclusionQualityLevel, diff --git a/crates/bevy_pbr/src/volumetric_fog/mod.rs b/crates/bevy_pbr/src/volumetric_fog/mod.rs index 9107bebd79..cbf735b592 100644 --- a/crates/bevy_pbr/src/volumetric_fog/mod.rs +++ b/crates/bevy_pbr/src/volumetric_fog/mod.rs @@ -44,6 +44,7 @@ use bevy_math::{ primitives::{Cuboid, Plane3d}, Vec2, Vec3, }; +use bevy_reflect::std_traits::ReflectDefault; use bevy_reflect::Reflect; use bevy_render::{ mesh::{Mesh, Meshable}, @@ -71,14 +72,14 @@ pub struct VolumetricFogPlugin; /// /// This allows the light to generate light shafts/god rays. #[derive(Clone, Copy, Component, Default, Debug, Reflect)] -#[reflect(Component)] +#[reflect(Component, Default, Debug)] pub struct VolumetricLight; /// When placed on a [`bevy_core_pipeline::core_3d::Camera3d`], enables /// volumetric fog and volumetric lighting, also known as light shafts or god /// rays. #[derive(Clone, Copy, Component, Debug, Reflect)] -#[reflect(Component)] +#[reflect(Component, Default, Debug)] pub struct VolumetricFog { /// Color of the ambient light. /// @@ -138,7 +139,7 @@ pub struct FogVolumeBundle { } #[derive(Clone, Component, Debug, Reflect)] -#[reflect(Component)] +#[reflect(Component, Default, Debug)] pub struct FogVolume { /// The color of the fog. /// diff --git a/crates/bevy_pbr/src/wireframe.rs b/crates/bevy_pbr/src/wireframe.rs index abb24aae7a..0b2c3bf47e 100644 --- a/crates/bevy_pbr/src/wireframe.rs +++ b/crates/bevy_pbr/src/wireframe.rs @@ -56,7 +56,7 @@ impl Plugin for WireframePlugin { /// /// This requires the [`WireframePlugin`] to be enabled. #[derive(Component, Debug, Clone, Default, Reflect, Eq, PartialEq)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug, PartialEq)] pub struct Wireframe; /// Sets the color of the [`Wireframe`] of the entity it is attached to. @@ -69,7 +69,7 @@ pub struct Wireframe; // This could blow up in size if people use random colored wireframes for each mesh. // It will also be important to remove unused materials from the cache. #[derive(Component, Debug, Clone, Default, Reflect)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug)] pub struct WireframeColor { pub color: Color, } @@ -79,11 +79,11 @@ pub struct WireframeColor { /// /// This requires the [`WireframePlugin`] to be enabled. #[derive(Component, Debug, Clone, Default, Reflect, Eq, PartialEq)] -#[reflect(Component, Default)] +#[reflect(Component, Default, Debug, PartialEq)] pub struct NoWireframe; #[derive(Resource, Debug, Clone, Default, ExtractResource, Reflect)] -#[reflect(Resource)] +#[reflect(Resource, Debug, Default)] pub struct WireframeConfig { /// Whether to show wireframes for all meshes. /// Can be overridden for individual meshes by adding a [`Wireframe`] or [`NoWireframe`] component.