bevy/examples/animation
Shaye Garg 0b5302d96a
Replace Ambient Lights with Environment Map Lights (#17482)
# Objective

Transparently uses simple `EnvironmentMapLight`s to mimic
`AmbientLight`s. Implements the first part of #17468, but I can
implement hemispherical lights in this PR too if needed.

## Solution

- A function `EnvironmentMapLight::solid_color(&mut Assets<Image>,
Color)` is provided to make an environment light with a solid color.
- A new system is added to `SimulationLightSystems` that maps
`AmbientLight`s on views or the world to a corresponding
`EnvironmentMapLight`.

I have never worked with (or on) Bevy before, so nitpicky comments on
how I did things are appreciated :).

## Testing

Testing was done on a modified version of the `3d/lighting` example,
where I removed all lights except the ambient light. I have not included
the example, but can if required.

## Migration
`bevy_pbr::AmbientLight` has been deprecated, so all usages of it should
be replaced by a `bevy_pbr::EnvironmentMapLight` created with
`EnvironmentMapLight::solid_color` placed on the camera. There is no
alternative to ambient lights as resources.
2025-03-04 07:40:53 +00:00
..
animated_mesh_control.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
animated_mesh_events.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
animated_mesh.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
animated_transform.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
animated_ui.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
animation_events.rs AnimationEvent -> Event and other improvements (#16440) 2024-11-22 00:16:04 +00:00
animation_graph.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
animation_masks.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
color_animation.rs ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
custom_skinned_mesh.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
eased_motion.rs AnimatedField and Rework Evaluators (#16484) 2024-11-27 22:19:55 +00:00
easing_functions.rs Add ways to configure EasingFunction::Steps via new StepConfig (#17752) 2025-02-11 22:19:01 +00:00
gltf_skinned_mesh.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
morph_targets.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00