bevyengine / bevy

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

Extreme Bloom on non-emissive dark surface. WebGl2 & Linux only #14288

Open paul-hansen opened 1 month ago

paul-hansen commented 1 month ago

Bevy version

v0.14.0

Relevant system information

cargo 1.79.0 (ffa9cf99a 2024-06-03) rustc 1.79.0 (129f3b996 2024-06-10) Arch Linux (EndeavorOS), KDE, (tested both Wayland and X11) Firefox 127.0.2 & Chrome 126.0.6478.126 Nvidia 3080 Driver version 555.58.02

AdapterInfo { name: "NVIDIA GeForce GTX 980, or similar", vendor: 4318, device: 0, device_type: Other, driver: "WebGL", driver_info: "2.0", backend: Gl }

What you did

I imported a model in my game that had a black material with a metallic value of 1.0

What went wrong

I was expecting it to display the same on PC and web, but on the web, the bloom went bonkers and covered the whole screen.

Additional information

I was able to replicate this in Bevy's bloom_3d example by changing one of the materials, specifically replace these lines with this:

    let material_emissive3 = materials.add(StandardMaterial {
        base_color: Color::BLACK,
        metallic: 1.0,
        ..default()
    });

Here's a screenshot of my game, with the PC version running normally: image Here's in Firefox showing the issue with the bloom (same result in Chrome) image

paul-hansen commented 1 month ago

Doesn't happen on Windows 11 on the same machine. Chrome 126.0.6478.127 & Firefox 127.0.2

JMS55 commented 1 month ago

Looks like a NaN/Inf issue to me.

IDEDARY commented 1 month ago

Also might be related: If you have HDR enabled and you set the clear color to transparent value (common for multiple camera setups), the screen quickly transitions to full bright white color looking very similar to this.