bevyengine / bevy

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

Some Examples are broken on Mobile WebGL #4582

Open NHodgesVFX opened 2 years ago

NHodgesVFX commented 2 years ago

Bevy version

I'm not sure, its whatever version of bevy the web examples are using at the time of writing this, if it tracks release then bevy 0.7

Operating system & version

S22 Ultra, Android 12

What you did

  1. Open Chrome or FireFox on Android
  2. Navigate to https://bevyengine.org/examples/3d/lighting/ or https://bevyengine.org/examples/3d/spherical-area-lights/
  3. Wait for the scene to load

What you expected to happen

The example scene renders without artifacts

What actually happened

the scene rendered with artifacts

Additional information

Any additional information you would like to add such as screenshots, logs, etc.

image image

superdump commented 2 years ago

Looks like a bug with clustered forward rendering. Perhaps the cluster index calculation breaks for some reason and then the cluster is shaded with the wrong light list.

astreetsign commented 2 years ago

same thing is happening on arch linux i am using amd juniper gpu

mrchantey commented 1 year ago

On my old pixel 3 the scene isnt rendering, might be a different issue from the OP. I can confirm that this is an issue with the Standard Material only, simple unlit materials render with no issue.

ERROR  Shader translation error for stage VERTEX | FRAGMENT | VERTEX_FRAGMENT: Assertion failed: false && "Unknown named pointer type or missing metadata"
ERROR  Please report it to https://github.com/gfx-rs/naga log.target = "wgpu::backend::direct";log.module_path = "wgpu::backend::direct";log.file = "C:\\Users\\petey\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\wgpu-0.15.1\\src\\backend\\direct.rs";log.line = 1183;
ERROR  Handling wgpu errors as fatal by default log.target = "wgpu::backend::direct";log.module_path = "wgpu::backend::direct";log.file = "C:\\Users\\petey\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\wgpu-0.15.1\\src\\backend\\direct.rs";log.line = 3023;

panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in VERTEX | FRAGMENT | VERTEX_FRAGMENT shader: Assertion failed: false && "Unknown named pointer type or missing metadata"
    ', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.15.1/src/backend/direct.rs:3024:5

Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (https://bevyengine.org/examples/3d/lighting/lighting.js:385:21)
    at console_error_panic_hook::hook::hef349c3cbcd73eef (wasm://wasm/057fe4da:wasm-function[10143]:0xb43173)
    at core::ops::function::Fn::call::hbe3ada901a6538a9 (wasm://wasm/057fe4da:wasm-function[45864]:0xf05cd7)
    at std::panicking::rust_panic_with_hook::h8d0a63d0479a36c8 (wasm://wasm/057fe4da:wasm-function[16696]:0xd4b378)
    at std::panicking::begin_panic_handler::{{closure}}::hac9eebb5245da5ff (wasm://wasm/057fe4da:wasm-function[18755]:0xdad96e)
    at std::sys_common::backtrace::__rust_end_short_backtrace::h1def76e070463564 (wasm://wasm/057fe4da:wasm-function[28550]:0xead550)
    at rust_begin_unwind (wasm://wasm/057fe4da:wasm-function[23912]:0xe5a9a2)
    at core::panicking::panic_fmt::h2a7f454a5f5da218 (wasm://wasm/057fe4da:wasm-function[27247]:0xe9b424)
    at core::ops::function::Fn::call::h8465aa2f6e6af7ec (wasm://wasm/057fe4da:wasm-function[16745]:0xd4dfe2)
    at wgpu::backend::direct::ErrorSinkRaw::handle_error::h1674e5c163f32e93 (wasm://wasm/057fe4da:wasm-function[11776]:0xbec21f)

Referenced section in wgpu/backend/direct.rs

impl crate::context::QueueWriteBuffer for QueueWriteBuffer {
    fn slice(&self) -> &[u8] {
        panic!()
    }
...
mrchantey commented 1 year ago

Update: The Bevy 0.11 WASM examples are currently working fine on my old Pixel 3 Android.

Edit: Lighting example still pixelated like OP.

NHodgesVFX commented 1 year ago

Sadly, the lighting example for me is still broken.