Skip to main content

Crate bevy_light

Crate bevy_light 

Source
Expand description

Provides component types for lighting a bevy scene. This includes the usual directional, point, and spot lights, as well as light probes, atmosphere, other volumetrics, and shadow configuration.

Re-exports§

pub use cluster::ClusteredDecal;
pub use atmosphere::Atmosphere;
pub use cascade::CascadeShadowConfig;
pub use cascade::CascadeShadowConfigBuilder;
pub use cascade::Cascades;

Modules§

atmosphere
Provides types to specify atmosphere lighting, scattering terms, etc.
cascade
Provides shadow cascade configuration and construction helpers.
cluster
Spatial clustering of objects to accelerate rendering performance.
light_consts
Constants for operating with the light units: lumens, and lux.
prelude
The light prelude.

Structs§

AmbientLight
An ambient light, which lights the entire scene equally.
AtmosphereEnvironmentMapLight
Lets the atmosphere contribute environment lighting (reflections and ambient diffuse) to your scene.
DirectionalLight
A Directional light.
DirectionalLightShadowMap
Controls the resolution of DirectionalLight and SpotLight shadow maps.
DirectionalLightTexture
Add to a DirectionalLight to add a light texture effect. A texture mask is applied to the light source to modulate its intensity,
simulating patterns like window shadows, gobo/cookie effects, or soft falloffs.
EnvironmentMapLight
A pair of cubemap textures that represent the surroundings of a specific area in space.
FogVolume
A unit cube of fog at the origin. Can be positioned and scaled with a Transform. Only visible by cameras with a VolumetricFog component when lit by a directional light with VolumetricLight.
GeneratedEnvironmentMapLight
A generated environment map that is filtered at runtime.
GlobalAmbientLight
The global ambient light, which lights the entire scene equally.
IrradianceVolume
The component that defines an irradiance volume.
LightPlugin
Sets up all the light visibility and clustering infrastructure needed for rendering lights.
LightProbe
A marker component for a light probe, which is a cuboid region that provides global illumination to all fragments inside it.
NotShadowCaster
Add this component to make a Mesh3d not cast shadows.
NotShadowReceiver
Add this component to make a Mesh3d not receive shadows.
PointLight
A light that emits light in all directions from a central point.
PointLightShadowMap
Controls the resolution of PointLight shadow maps.
PointLightTexture
Add to a PointLight to add a light texture effect. A texture mask is applied to the light source to modulate its intensity,
simulating patterns like window shadows, gobo/cookie effects, or soft falloffs.
RectLight
A rectangular area light.
Skybox
Adds a skybox to a 3D camera, based on a cubemap texture.
SpotLight
A light that emits light in a given direction from a central point.
SpotLightTexture
Add to a SpotLight to add a light texture effect. A texture mask is applied to the light source to modulate its intensity,
simulating patterns like window shadows, gobo/cookie effects, or soft falloffs.
SunDisk
Add to a DirectionalLight to control rendering of the visible solar disk in the sky. Affects only the disk’s appearance, not the light’s illuminance or shadows. Requires a bevy::pbr::Atmosphere component on a Camera3d to have any effect.
TransmittedShadowReceiver
Add this component to make a Mesh3d using a PBR material with StandardMaterial::diffuse_transmission > 0.0 receive shadows on its diffuse transmission lobe. (i.e. its “backside”)
VolumetricFog
When placed on a bevy_camera::Camera3d, enables volumetric fog and volumetric lighting, also known as light shafts or god rays.
VolumetricLight
Add this component to a DirectionalLight with a shadow map (shadow_maps_enabled: true) to make volumetric fog interact with it.

Enums§

ParallaxCorrection
Add this component to a reflection probe to customize parallax correction.
ShadowFilteringMethod
Add this component to a Camera3d to control how to anti-alias shadow edges.
SimulationLightSystems
System sets used to run light-related systems.

Functions§

automatically_add_parallax_correction_components
A system that automatically adds a ParallaxCorrection::Auto component to any reflection probe that doesn’t already have a ParallaxCorrection component.
check_dir_light_mesh_visibility
Updates the visibility for DirectionalLights so that shadow map rendering can work.
check_point_light_mesh_visibility
Updates the visibility for PointLights and SpotLights so that shadow map rendering can work.
get_shadow_lod_origin
Determines the LOD origin for spot and point light shadow maps.
orthonormalize
Constructs a right-handed orthonormal basis from a given unit Z vector.
spot_light_clip_from_view
Creates the projection matrix that transforms the light’s view space into the light’s clip space.
spot_light_world_from_view
Constructs a right-handed orthonormal basis with translation, using only the forward direction and translation of a given GlobalTransform.
update_directional_light_frusta
Updates the frusta for all visible shadow mapped DirectionalLights.
update_point_light_frusta
Updates the frusta for all visible shadow mapped PointLights.
update_spot_light_frusta
Updates the frusta for all visible shadow mapped SpotLights.

Type Aliases§

WithLight
A convenient alias for Or<(With<PointLight>, With<SpotLight>, With<DirectionalLight>, With<RectLight>)>, for use with bevy_camera::visibility::VisibleEntities.