mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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:
parent
e164e5a873
commit
c1c003d3c7
1 changed files with 10 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue