bevy/crates/bevy_pbr
akimakinai 50d38f2757
Fix point light count limit (#16062)
# Objective

- I made a mistake in #15902, specifically [this
diff](e2faedb99c)
-- the `point_light_count` variable is used for all point lights, not
just shadow mapped ones, so I cannot add `.min(max_texture_cubes)`
there. (Despite `spot_light_count` having `.min(..)`)

It may have broken code like this (where `index` is index of
`point_light` vec):


9930df83ed/crates/bevy_pbr/src/render/light.rs (L848-L850)

and also causes panic here:

9930df83ed/crates/bevy_pbr/src/render/light.rs (L1173-L1174)

## Solution

- Adds `.min(max_texture_cubes)` directly to the loop where texture
views for point lights are created.

## Testing

- `lighting` example (with the directional light removed; original
example doesn't crash as only 1 directional-or-spot light in total is
shadow-mapped on webgl) no longer crashes on webgl
2024-10-22 23:29:58 +00:00
..
src Fix point light count limit (#16062) 2024-10-22 23:29:58 +00:00
Cargo.toml Meshlet new error projection (#15846) 2024-10-22 20:14:30 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy PBR

License Crates.io Downloads Docs Discord