use bevy_camera::visibility::{Visibility, VisibilityClass};1use bevy_color::Color;2use bevy_ecs::prelude::*;3use bevy_reflect::prelude::*;4use bevy_transform::components::Transform;56use crate::light_consts;78/// A rectangular area light.9///10/// The rectangle lies in the XY plane of the entity's local coordinate frame11/// and faces the local -Z direction.12///13/// Shadow maps are currently unsupported, objects illuminated by a14/// ``RectLight`` will not cast shadows.15///16/// Note: Requires the `area_light_luts` cargo feature.17#[derive(Component, Debug, Clone, Copy, Reflect)]18#[reflect(Component, Default, Debug, Clone)]19#[require(Transform, Visibility, VisibilityClass)]20pub struct RectLight {21/// The color of the light.22///23/// By default, this is white.24pub color: Color,2526/// Luminous power in lumens, representing the amount of light emitted by this source in all directions.27pub intensity: f32,2829/// Cut-off for the light's area-of-effect. Fragments outside this range will not be affected by30/// this light at all, so it's important to tune this together with `intensity` to prevent hard31/// lighting cut-offs.32pub range: f32,3334/// Width of the light rectangle (along local X).35pub width: f32,3637/// Height of the light rectangle (along local Y).38pub height: f32,39}4041impl Default for RectLight {42fn default() -> Self {43RectLight {44color: Color::WHITE,45intensity: light_consts::lumens::VERY_LARGE_CINEMA_LIGHT,46width: 1.0,47height: 1.0,48range: 20.0,49}50}51}525354