bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.86k stars 3.54k forks source link

Directional lights and spot lights do not have shadow on WebGL on chromium. Shader compilation failed on Firefox. #15944

Open newDINO opened 6 days ago

newDINO commented 6 days ago

Bevy version

0.14.2 and the version used for demos on bevyengine.org

[Optional] Relevant system information

cargo 1.81.0 (2dbb1af80 2024-08-20) Arch Linux rolling, Linux 6.11.3-arch1-1 Chromium Version 129.0.6668.100 (Official Build) Arch Linux (64-bit) Firefox 131.0.2 (64-bit)

` AdapterInfo { name: "ANGLE (AMD, AMD Radeon RX 480 Graphics (radeonsi polaris10 LLVM 18.1.8), OpenGL 4.6)", vendor: 4098, device: 0, device_type: Other, driver: "WebGL 2.0 (OpenGL ES", driver_info: "3.0 Chromium)", backend: Gl }`

What you did

  1. Running a program containing directional light with shadow enabled in both native and web platform.
  2. Running the demo at https://bevyengine.org/examples/3d-rendering/spotlight/.
  3. Running other demos with only point lights.

What went wrong

  1. Native build shows clear shadow, while wasm doesn't.
  2. When running on chromium, it doesn't show the shadow as the cover of the demo shows. When running on firefox, the shader translation failed(Seems to be a wgpu issue).
  3. Point light shadows are normal.

Additional information

Image Image

mockersf commented 5 days ago

Firefox is generally broken, the fix will come in Firefox 132: https://github.com/bevyengine/bevy/issues/14415