godot icon indicating copy to clipboard operation
godot copied to clipboard

Vulkan: Screen-space effects (SSAO, SSIL, SSR) sometimes break when the viewport is resized

Open unfa opened this issue 2 years ago • 5 comments

Godot version

4.0 dev beta 3

System information

Windows 10, AMD Radeon RX6800XT

Issue description

On Windows my game shows a bunch of horizontal stripes across the screen: image

This isn't present on Arch Linux KDE X11 with Mesa drivers on the exact same hardware: image

The issue seems to be related to changing window (viewport) dimensions. Disabling fullscreen in the game seems to help:

  1. Hit ~ key to open in-game console
  2. Type display_fullscreen false
  3. Type quit and restart the game

Steps to reproduce

  1. Clone Liblast's repo: https://codeberg.org/Liblast/Liblast
  2. Don't forget lfs install && lfs pull or you'll have no assets
  3. Run the game

Minimal reproduction project

No response

unfa avatar Oct 14 '22 11:10 unfa

It seems that screen-space effects are affected by this.

image

  1. Look at the green face screen-space reflection that's incorrectly cast on the floor surface
  2. The background scene is supposed to be blurred out with bokeh, but it seems that effect sis broken as well.
  3. Glow also seems to be affected by the stripes
  4. Bokeh however is rendered correctly where the backdrop of the scene is the sky, and not any geometry.

unfa avatar Oct 14 '22 14:10 unfa

Resizing the window will break SSAO/SSIL/SSR in my experience, on any OS and graphics card model. This does not always occur, and resizing the window again can sometimes fix the issue. Resizing the window by dragging the handles may also behave differently compared to maximizing/restoring the window, as dragging the handles causes continuous resizing instead of resizing just once.

Calinou avatar Oct 14 '22 16:10 Calinou

Is this still broken? I fixed a bunch of bugs around SSAO/SSIL/SSR detecting changes in buffer sizes awhile back.

BastiaanOlij avatar Dec 06 '22 11:12 BastiaanOlij

I can't reproduce this issue with SSAO anymore as of 4.0.beta7 (Linux, AMD Radeon RX 6900 XT with RADV):

Half Size disabled

https://user-images.githubusercontent.com/180032/205954430-2d3b87de-5ec4-475b-b728-336df97a138b.mp4

Half Size Enabled

See https://github.com/godotengine/godot/issues/62881.

https://user-images.githubusercontent.com/180032/205954460-cc6d5fc2-09f0-4836-b2d7-58b7e495ec52.mp4

Minimal reproduction project: test_ssao_resize.zip

Calinou avatar Dec 06 '22 15:12 Calinou

I'll have to test it. It only happened on Windows 10, never on Linux, despite running on the exact same hardware.

unfa avatar Dec 06 '22 15:12 unfa

I can confirm that SSIL breaks on Win 10 with a Radeon 6900XT running the latest drivers.

Steps to reproduce:

  1. Open a scene with SSIL enabled (e.g. https://github.com/Rytelier/Godot-4-forest-benchmark)
  2. Move the camera so that some geometry goes beyond the bottom border.
  3. Behold, artifacts!
Example image

image

Resizing the viewport fixes and/or causes this problem. My guess is that there are problems with the buffer size, but I haven't looked deeper into it yet.

Ansraer avatar Dec 17 '22 15:12 Ansraer

Related: https://github.com/godotengine/godot/issues/62881 and https://github.com/godotengine/godot/issues/65987

clayjohn avatar Jan 18 '23 05:01 clayjohn

Should be fixed with #72838

Small footnote that with fixing SSR there seems to be a new issue where high roughness causes small reflections to blur into star shapes. We'll investigate that with a separate issue (if we don't figure this out today).

BastiaanOlij avatar Feb 09 '23 05:02 BastiaanOlij

I can still reproduce this on Windows in v4.1.2.stable.official [399c9dc39] using AMD Radeon RX6800XT GPU. Same hardware on Linux doesn't have this issue.

This here is a transparent mesh using a visual shader: image

And here it's on a transparent mesh (colorful trail) and on volumetric fog (partially?): image

Happens for SSR as well: image

unfa avatar Oct 23 '23 13:10 unfa

@unfa Do you use any level of MSAA? See https://github.com/godotengine/godot/issues/61415.

Calinou avatar Oct 23 '23 16:10 Calinou