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
This commit is contained in:
parent
ced36021d0
commit
6ab8e0d9c7
@ -17,7 +17,7 @@ use bevy_render::{
|
|||||||
};
|
};
|
||||||
use bevy_transform::components::{GlobalTransform, Transform};
|
use bevy_transform::components::{GlobalTransform, Transform};
|
||||||
use bevy_utils::Parallel;
|
use bevy_utils::Parallel;
|
||||||
use core::{marker::PhantomData, ops::DerefMut};
|
use core::ops::DerefMut;
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
pub use light::spot_light::{spot_light_clip_from_view, spot_light_world_from_view};
|
pub use light::spot_light::{spot_light_clip_from_view, spot_light_world_from_view};
|
||||||
@ -91,16 +91,6 @@ pub mod light_consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Marker resource for whether shadows are enabled for this material type
|
|
||||||
#[derive(Resource, Debug)]
|
|
||||||
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
|
|
||||||
|
|
||||||
impl<M: Material> Default for ShadowsEnabled<M> {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self(PhantomData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Controls the resolution of [`PointLight`] shadow maps.
|
/// Controls the resolution of [`PointLight`] shadow maps.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -1717,3 +1717,13 @@ pub fn write_material_bind_group_buffers(
|
|||||||
allocator.write_buffers(&render_device, &render_queue);
|
allocator.write_buffers(&render_device, &render_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Marker resource for whether shadows are enabled for this material type
|
||||||
|
#[derive(Resource, Debug)]
|
||||||
|
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
|
||||||
|
|
||||||
|
impl<M: Material> Default for ShadowsEnabled<M> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self(PhantomData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user