pub struct LightingPlan {
pub world_rect: [f32; 4],
pub layers: u32,
pub layer_clamp: u32,
pub lights: Vec<PlannedLight>,
pub ambient: AmbientLight,
pub issues: Vec<LightIssue>,
pub occluder_rejects: Vec<OccluderReject>,
pub culled: usize,
}Expand description
Everything the GPU pass needs for one frame, decided on the CPU.
Fields§
§world_rect: [f32; 4]Visible world rect the accumulator covers: [x, y, w, h] with x/y
the top-left (the accumulator’s uv origin).
layers: u32Accumulator layers, including the trailing identity layer items with
no layer read. At least 2, because a one-layer array texture is
unsafe to sample on GL/ANGLE (see
atlas_shape).
layer_clamp: u32layers - 1: the highest index an item may sample.
lights: Vec<PlannedLight>Lights in accumulation order.
ambient: AmbientLightThe ambient light, resolved per layer by Self::ambient_rgb.
issues: Vec<LightIssue>Every light the plan altered or dropped, in input order.
occluder_rejects: Vec<OccluderReject>Occluders rejected before any light was planned.
culled: usizeLights skipped because their footprint misses the visible rect. Culling is not a budget drop, so these are counted, not reported.
Implementations§
Source§impl LightingPlan
impl LightingPlan
Sourcepub fn wedge_vertices(&self) -> usize
pub fn wedge_vertices(&self) -> usize
Vertices all lights’ wedges need.
Sourcepub fn ambient_rgb(&self, layer: u32) -> [f32; 3]
pub fn ambient_rgb(&self, layer: u32) -> [f32; 3]
Ambient rgb added to layer before any light: color * energy when
the ambient’s mask reaches the layer. The trailing identity layer is
always [0, 0, 0], so unlit items stay exactly unlit.
Trait Implementations§
Source§impl Clone for LightingPlan
impl Clone for LightingPlan
Source§impl Debug for LightingPlan
impl Debug for LightingPlan
Source§impl PartialEq for LightingPlan
impl PartialEq for LightingPlan
impl StructuralPartialEq for LightingPlan
Auto Trait Implementations§
impl Freeze for LightingPlan
impl RefUnwindSafe for LightingPlan
impl Send for LightingPlan
impl Sync for LightingPlan
impl Unpin for LightingPlan
impl UnsafeUnpin for LightingPlan
impl UnwindSafe for LightingPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.