diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index a4a8eb8401..da11e416bc 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -793,7 +793,19 @@ pub struct PreparedMaterial { } #[derive(Component, Clone, Copy, Default, PartialEq, Eq, Deref, DerefMut)] -pub struct MaterialBindGroupId(Option); +pub struct MaterialBindGroupId(pub Option); + +impl MaterialBindGroupId { + pub fn new(id: BindGroupId) -> Self { + Self(Some(id)) + } +} + +impl From for MaterialBindGroupId { + fn from(value: BindGroup) -> Self { + Self::new(value.id()) + } +} impl PreparedMaterial { pub fn get_bind_group_id(&self) -> MaterialBindGroupId { diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index 4b4e0844a0..46616e4765 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -29,30 +29,30 @@ use crate::*; #[derive(Component)] pub struct ExtractedPointLight { - color: Color, + pub color: Color, /// luminous intensity in lumens per steradian - intensity: f32, - range: f32, - radius: f32, - transform: GlobalTransform, - shadows_enabled: bool, - shadow_depth_bias: f32, - shadow_normal_bias: f32, - spot_light_angles: Option<(f32, f32)>, + pub intensity: f32, + pub range: f32, + pub radius: f32, + pub transform: GlobalTransform, + pub shadows_enabled: bool, + pub shadow_depth_bias: f32, + pub shadow_normal_bias: f32, + pub spot_light_angles: Option<(f32, f32)>, } #[derive(Component, Debug)] pub struct ExtractedDirectionalLight { - color: Color, - illuminance: f32, - transform: GlobalTransform, - shadows_enabled: bool, - shadow_depth_bias: f32, - shadow_normal_bias: f32, - cascade_shadow_config: CascadeShadowConfig, - cascades: EntityHashMap>, - frusta: EntityHashMap>, - render_layers: RenderLayers, + pub color: Color, + pub illuminance: f32, + pub transform: GlobalTransform, + pub shadows_enabled: bool, + pub shadow_depth_bias: f32, + pub shadow_normal_bias: f32, + pub cascade_shadow_config: CascadeShadowConfig, + pub cascades: EntityHashMap>, + pub frusta: EntityHashMap>, + pub render_layers: RenderLayers, } #[derive(Copy, Clone, ShaderType, Default, Debug)]