pub struct LightUnit {
pub candela_per_unit: f32,
}Expand description
What one unit of the source’s own value of a point or spot light is in candela: the calibration the lowering that
made the world’s point and spot core.lights chose (a directional light’s intensity, in lux, is not in it). Such a
light’s intensity is its source value times candela_per_unit, so colour * intensity / candela_per_unit is the
value the source stored, the one a program of the source reads its lights in (crate::shader::LightValue::Colour). The lowering that makes the lights writes it; a world whose lights no
lowering made (a scene read in candela) has none, and a light table’s colours have no value there.
Fields§
§candela_per_unit: f32Candela per unit of the source’s light value; finite and above 0.
Trait Implementations§
impl Copy for LightUnit
Source§impl Resource for LightUnit
impl Resource for LightUnit
Source§fn verify(&self, _w: &World) -> Result<(), String>
fn verify(&self, _w: &World) -> Result<(), String>
A finite factor above 0: a light of the source’s value 1 has some intensity.
const NAME: &'static str = "core.light_unit"
const VERSION: u32 = 1
Source§fn references(&self, _out: &mut Vec<Entity>)
fn references(&self, _out: &mut Vec<Entity>)
out. A resource holding entity references must declare
every one of them and implement Resource::retain_references.Source§fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
keep refuses (set it to “none”). The world calls it whenever entities
leave it (World::despawn, World::retain, World::move_components) and on the copy a
World::subset or World::split_off part gets, so a resource never refers to an entity its world lacks.