bevy/examples/asset
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
..
files Fix asset_settings example regression (#15945) 2024-10-16 14:16:23 +00:00
processing Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
alter_mesh.rs simplify example, replace get_single to Single Query (#16187) 2024-11-01 18:25:42 +00:00
alter_sprite.rs Allowed creating uninitialized images (for use as storage textures) (#17760) 2025-02-10 22:22:07 +00:00
asset_decompression.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
asset_loading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
asset_settings.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
custom_asset_reader.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
custom_asset.rs Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
embedded_asset.rs Adding More Comments to the Embedded Assets Example (#17865) 2025-02-24 21:13:24 +00:00
extra_source.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
hot_asset_reloading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
multi_asset_sync.rs Replace Ambient Lights with Environment Map Lights (#17482) 2025-03-04 07:40:53 +00:00
repeated_texture.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00