Skip to content

Commit 6ab8e0d

Browse files
authored
move ShadowsEnabled to material (#19963)
# Objective - Make bevy_light possible ## Solution - Move non-light stuff out of light module (its a marker for whether a material should cast shadows: thats a material property not a light property) ## Testing - 3d_scene runs
1 parent ced3602 commit 6ab8e0d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/bevy_pbr/src/light/mod.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use bevy_render::{
1717
};
1818
use bevy_transform::components::{GlobalTransform, Transform};
1919
use bevy_utils::Parallel;
20-
use core::{marker::PhantomData, ops::DerefMut};
20+
use core::ops::DerefMut;
2121

2222
use crate::*;
2323
pub use light::spot_light::{spot_light_clip_from_view, spot_light_world_from_view};
@@ -91,16 +91,6 @@ pub mod light_consts {
9191
}
9292
}
9393

94-
/// Marker resource for whether shadows are enabled for this material type
95-
#[derive(Resource, Debug)]
96-
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
97-
98-
impl<M: Material> Default for ShadowsEnabled<M> {
99-
fn default() -> Self {
100-
Self(PhantomData)
101-
}
102-
}
103-
10494
/// Controls the resolution of [`PointLight`] shadow maps.
10595
///
10696
/// ```

crates/bevy_pbr/src/material.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,3 +1717,13 @@ pub fn write_material_bind_group_buffers(
17171717
allocator.write_buffers(&render_device, &render_queue);
17181718
}
17191719
}
1720+
1721+
/// Marker resource for whether shadows are enabled for this material type
1722+
#[derive(Resource, Debug)]
1723+
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
1724+
1725+
impl<M: Material> Default for ShadowsEnabled<M> {
1726+
fn default() -> Self {
1727+
Self(PhantomData)
1728+
}
1729+
}

0 commit comments

Comments
 (0)