google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.36k stars 1.84k forks source link

Teared rendering results with artifacts when blend mode is translucent #7794

Open hannojg opened 2 months ago

hannojg commented 2 months ago

Describe the bug

When rendering content with filament with transparency the image is pixelated / is torn apart / has artifacts. In general it works, we were able to reproduce this especially on google pixel devices. The original discussion started here:

To Reproduce

  1. Run the sample-transparent-view demo on a google pixel device. We used a Pixel 7 Pro

Expected behavior

its rendered without tearing and artifacts.

Screenshots

IMG_7748

https://github.com/google/filament/assets/16821682/845bd3aa-418d-4099-bf26-089a90ed61dd

https://github.com/google/filament/assets/16821682/93540204-6d84-44d0-b65f-aecc74b23383

Logs If applicable, copy full logs from your console here. Please do not use screenshots of logs, copy them as text, use gist or attach an uncompressed file.

Providing those in a moment, will run the sample app with the debug flags enabled.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

The problem seems to be fixed on Pixel devices when either:

hannojg commented 2 months ago

Note: not sure if its strictly the fact that its using transparency or the fact that no skybox is used. In our app I tried to set blending mode to opaque and set no clear options, and this still happened.

The other samples work, but they all use skyboxes if I am not mistaken

hannojg commented 2 months ago

Update:

In the multi-view example I was able to circumnavigate the issue by commenting out this line:

https://github.com/google/filament/blob/99eac62b4e0f58b3beaf1d49effe76b6dfdecaae/android/samples/sample-multi-view/src/main/java/com/google/android/filament/multiview/MainActivity.kt#L136

So I assume it's not related to the skybox but really just to the translucent blending mode. (In our app I need to render the content with transparency, so just turning it off is not an option for me unfortunately)

pixelflinger commented 1 month ago

I can reproduce, the problem seems to be linked to our use of the framebuffer_fetch extension on these devices. Enabling any feature that turns that off will appear to fix the problem. For instance enabling MSAA, TAA, DoF or bloom. Also disabling post-processing or color grading. This needs more investigation...

pixelflinger commented 1 month ago

The problem also goes away when I change our internal format from RGBA16F to RGBA8. This starts looking like a driver bug.

genesis-talsemgeest commented 1 month ago

Hi, we are having the same issue. Is this going to be fixed on the Filament side, or are we waiting for Pixel to fix their driver?

genesis-talsemgeest commented 3 weeks ago

@pixelflinger ^