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

Fixing issues with SSIL artifacts #73859

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

BastiaanOlij
Copy link
Contributor

In SSIL and SSAO we slice our screen up into 4 layers, for this we half the size of the screen, 4 slices at half the resolution makes up our starting size.
If half size is on, we half this size again.

In both cases we round up if the screen resolution can't be nicely divided by 2 or 4.

When dispatching our compute shaders however, there are many places where we shift by 1 or 2 to half or quarter the size. This has the result that the resolution is rounded down.
This causes the pixels in the border of our textures to not be written to. When resizing the window the old buffers are freed and new buffers allocated, these buffers often take up the space of the previously freed buffers and we get whatever junk is in there.
This junk then potentially leads to computational errors which causes the artifacts we've seen at the side of the image.

This PR ensures we are using the actual buffer sizes when calling compute_list_dispatch_threads ensuring full coverage of the buffers.

Fixes #56724

@BastiaanOlij BastiaanOlij added this to the 4.0 milestone Feb 24, 2023
@BastiaanOlij BastiaanOlij requested a review from a team as a code owner February 24, 2023 05:24
@BastiaanOlij BastiaanOlij self-assigned this Feb 24, 2023
@akien-mga akien-mga merged commit 28991a9 into godotengine:master Feb 24, 2023
@akien-mga
Copy link
Member

Thanks!

@BastiaanOlij BastiaanOlij deleted the fix_ssil_artifacts branch February 25, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan: SSIL causes partial viewport flashing when resizing the window
2 participants