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

Fix ssao only sampling mip 0 #11292

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

Elabajaba
Copy link
Contributor

Objective

Fixes #11222

Solution

SSAO's sample_mip_level was always giving negative values because it was in UV space (0..1) when it needed to be in pixel units (0..resolution).

Fixing it so it properly samples lower mip levels when appropriate is a pretty large speedup (~3.2ms -> ~1ms at 4k, ~507us-> 256us at 1080p on a 6800xt), and I didn't notice any obvious visual quality differences.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Jan 11, 2024
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 11, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 11, 2024
@alice-i-cecile alice-i-cecile removed this pull request from the merge queue due to a manual request Jan 11, 2024
@alice-i-cecile
Copy link
Member

Holding off for a moment: @JMS55 said they wanted to try benchmarking this.

@JMS55
Copy link
Contributor

JMS55 commented Jan 12, 2024

Makes no difference on a 3080 lol, but don't know how to run a profiler on my laptop /shrug

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 12, 2024
Merged via the queue into bevyengine:main with commit 64a15f1 Jan 12, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSAO only samples mip 0 leading to worse than expected performance.
6 participants