Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

METAL backend visual corruption with ClearOptions::clear=false #8229

Open
emezeske opened this issue Oct 24, 2024 · 1 comment
Open

METAL backend visual corruption with ClearOptions::clear=false #8229

emezeske opened this issue Oct 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working metal Issue/request specific to Metal

Comments

@emezeske
Copy link
Contributor

Describe the bug
On the METAL backend, various weird screen corruption occurs if ClearOptions::clear = false.

For whatever reason, it is very easy to reproduce in my app, but it is also possible to get gltf_viewer to do weird things.

Here's a video showing the corruption in my app: https://youtu.be/1Nca9RJ3Ucg.

To Reproduce
Steps to reproduce the behavior:

  1. On MacOS with the METAL backend
  2. Edit filament/libs/viewer/src/Settings.cpp, change renderer->setClearOptions() to set .clear = false (line 640)
  3. Build and run gltf_viewer
  4. Play around with settings until corruption happens.
  5. For me, I found I could reliably get corruption with Dithering=true Bloom=true Screen-space-guard=true BloomThreshold=false
  6. Also cranking up the bloom amount, you can sometimes then rotate the camera until weird corruption occurs

Expected behavior
There should not be any visual corruption, particularly when there's a skybox.

I understand that there is corruption behind the imgui menus -- that's not what I'm talking about. It's corruption in the 3D view, with white boxes appearing, or with the bloom flickering in weird ways.

Screenshots
If applicable, add screenshots to help explain your problem.

Here's an example of what it looks like with .clear=true:
Image

And here it is with .clear=false:
Image

Logs
I1024 23:17:40.172563 0x1709cf000.1 model_renderer.cc:99] [Filament I]: FEngine (64 bits) created at 0x133839800 (threading is enabled)
I1024 23:17:40.172622 0x170da3000.0 model_renderer.cc:99] [Filament I]: FEngine resolved backend: Metal
I1024 23:17:40.176935 0x170da3000.0 model_renderer.cc:99] [Filament I]: Selected physical device 'Apple M1'
I1024 23:17:40.177008 0x170da3000.0 model_renderer.cc:104] [Filament V]: Supported GPU families:
I1024 23:17:40.177010 0x170da3000.0 model_renderer.cc:104] [Filament V]: MTLGPUFamilyCommon3
I1024 23:17:40.177011 0x170da3000.0 model_renderer.cc:104] [Filament V]: MTLGPUFamilyApple7
I1024 23:17:40.177012 0x170da3000.0 model_renderer.cc:104] [Filament V]: MTLGPUFamilyMac2
I1024 23:17:40.177013 0x170da3000.0 model_renderer.cc:104] [Filament V]: Features:
I1024 23:17:40.177016 0x170da3000.0 model_renderer.cc:104] [Filament V]: readWriteTextureSupport: true
I1024 23:17:40.177276 0x1709cf000.1 model_renderer.cc:99] [Filament I]: Backend feature level: 3
I1024 23:17:40.177281 0x1709cf000.1 model_renderer.cc:99] [Filament I]: FEngine feature level: 1

Desktop (please complete the following information):

  • OS: MacOS
  • GPU: Macbook M1 pro
  • Backend: Metal

Smartphone (please complete the following information):
N/A

Additional context
N/A

@emezeske
Copy link
Contributor Author

It would perhaps be helpful to mention that I've seen a bunch of other visual corruptions, which I didn't reproduce for the video, but none of which have occurred since I changed to clear=true:

  • Weird green tinting to objects after messing with refraction/reflection settings
  • Flickering white boxes around areas of the screen with a lot of bloom going on
  • Bloom effect bleeding/flickering in from the edges of the screen, where there shouldn't be any bloom

@pixelflinger pixelflinger added metal Issue/request specific to Metal bug Something isn't working labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metal Issue/request specific to Metal
Projects
None yet
Development

No branches or pull requests

3 participants