filament icon indicating copy to clipboard operation
filament copied to clipboard

SSAO Anomaly With Vulkan

Open errissa opened this issue 3 years ago • 1 comments

Describe the bug After updating to v1.15.1 from 1.9.19 I noticed in my application that with the Vulkan backend (which Filament now selects by default) that SSAO was unstable with a shimmering rendering anomaly. The intensity of the anomaly depends on whether or not half resolution is selected or not. I confirmed running Filament's gltf_viewer sample that the Vulkan backend had the same unstable anomaly. The anomaly is not present when running with OpenGL backend.

To Reproduce Run gltf_viewer. On my system it defaults to Vulkan backend which exhibits the SSAO 'shimmering' anomaly. Running gltf_viewer -a opengl the SSAO effect is stable.

Expected behavior No SSAO anomaly with Vulkan backend.

Screenshots SSAO unstable with Vulkan: vulkan

SSAO stable with OpenGL: opengl

Logs If applicable, copy logs from your console here. Please do not use screenshots of logs, copy them as text.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • GPU: Nvidia GeForce RTX 2060, driver 495.44
  • Backend: Vulkan

errissa avatar Dec 31 '21 03:12 errissa

This seems to be caused by VK_ATTACHMENT_STORE_OP_DONT_CARE being set for the depth attachments in the ssao/blur passes.

Manually setting this in the RenderPassInfo in the ssao and blur passes before the render call fixes it, but it feels like a hack... ssao.params.flags.discardEnd &= ~TargetBufferFlags::DEPTH;

cg-co avatar Apr 29 '22 13:04 cg-co

@errissa would you mind providing the console output for gltf_viewer with the device driver and physical device info? In my console, it reads like

Vulkan device driver: radv Mesa 22.2.0       
Selected physical device 'AMD Radeon Pro WX 3200 Series (RADV POLARIS12)' from 2 physical devices. (vendor 0x1002, device 0x6981, driver 0x5802000, api 1.3)

I was not able to repro using two different AMD drivers.

poweifeng avatar Jan 11 '23 00:01 poweifeng

@poweifeng I'm currently busy with other work but I will test this again with the latest Filament and report what I find within a week or so. In the meantime, if it's helpful, I was on an Nvidia RTX 2060 with the 495.44 driver when I reported this issue.

errissa avatar Jan 11 '23 03:01 errissa

Can confirm this on an NV RTX 2060 on Windows 10 too. May be related to #6216 ?

Nolram12345 avatar Feb 02 '23 18:02 Nolram12345

Duplicate of #6216

poweifeng avatar Mar 03 '23 20:03 poweifeng

Duplicate of #6216

No its not (as you seem to have correctly identified now) - its a separate issue. See what was posted by cg-co above:

This seems to be caused by VK_ATTACHMENT_STORE_OP_DONT_CARE being set for the depth attachments in the ssao/blur passes.

Nolram12345 avatar Mar 05 '23 18:03 Nolram12345