mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Make more things pub in the renderer (#12053)
# Objective - Some properties of public types are private but sometimes it's useful to be able to set those ## Solution - Make more stuff pub --- ## Changelog - `MaterialBindGroupId` internal id is now pub and added a new() constructor - `ExtractedPointLight` and `ExtractedDirectionalLight` properties are now all pub --------- Co-authored-by: James Liu <contact@jamessliu.com>
This commit is contained in:
parent
caa7ec68d4
commit
e79b9b62ce
2 changed files with 32 additions and 20 deletions
|
@ -794,7 +794,19 @@ pub struct PreparedMaterial<T: Material> {
|
|||
}
|
||||
|
||||
#[derive(Component, Clone, Copy, Default, PartialEq, Eq, Deref, DerefMut)]
|
||||
pub struct MaterialBindGroupId(Option<BindGroupId>);
|
||||
pub struct MaterialBindGroupId(pub Option<BindGroupId>);
|
||||
|
||||
impl MaterialBindGroupId {
|
||||
pub fn new(id: BindGroupId) -> Self {
|
||||
Self(Some(id))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BindGroup> for MaterialBindGroupId {
|
||||
fn from(value: BindGroup) -> Self {
|
||||
Self::new(value.id())
|
||||
}
|
||||
}
|
||||
|
||||
/// An atomic version of [`MaterialBindGroupId`] that can be read from and written to
|
||||
/// safely from multiple threads.
|
||||
|
|
|
@ -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<Vec<Cascade>>,
|
||||
frusta: EntityHashMap<Vec<Frustum>>,
|
||||
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<Vec<Cascade>>,
|
||||
pub frusta: EntityHashMap<Vec<Frustum>>,
|
||||
pub render_layers: RenderLayers,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, ShaderType, Default, Debug)]
|
||||
|
|
Loading…
Reference in a new issue