Fix num_cascades in split_screen exmample for WebGL (#14601)

# Objective

- Fixes #14595

## Solution

- Use `num_cascades: 1` in WebGL build.
`CascadeShadowConfigBuilder::default()` gives this number in WebGL:
8235daaea0/crates/bevy_pbr/src/light/mod.rs (L241-L248)

## Testing

- Tested the modified example in WebGL with Firefox/Chrome

---------

Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
This commit is contained in:
akimakinai 2024-08-04 22:57:22 +09:00 committed by GitHub
parent e164e5a873
commit c1c003d3c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,16 @@ fn setup(
..default()
},
cascade_shadow_config: CascadeShadowConfigBuilder {
num_cascades: 2,
num_cascades: if cfg!(all(
feature = "webgl2",
target_arch = "wasm32",
not(feature = "webgpu")
)) {
// Limited to 1 cascade in WebGL
1
} else {
2
},
first_cascade_far_bound: 200.0,
maximum_distance: 280.0,
..default()