-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Added visibility bitmask as an alternative SSAO method #13454
base: main
Are you sure you want to change the base?
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
References for reviewers: |
I added a few questions to answer before merging this and also added a linear sampler for the depth texture since I noticed it slightly improves some of the ghosting noticeable in small objects that happens due to the low resolution mip that gets selected for far-away samples. |
Another good reference: https://cybereality.com/screen-space-indirect-lighting-with-visibility-bitmask-improvement-to-gtao-ssao-real-time-ambient-occlusion-algorithm-glsl-shader-implementation/ @dragostis to give you an update, I'd still like to get this merged for Bevy 0.15 if you're interested. It's just going to be a very slow process, as reviewer bandwidth is very limited, and we have a large backlog of rendering PRs. I'll try to test this out in a few weeks when I'll have more free time, and help push it forward. |
@JMS55, I'm happy to get this merged for 0.15! In it's current form, it only handles AO. Adding GI as well is quite straightforward algorithm-wise, but would require extra textures and a separate denoise pass to look good. |
Yeah lets not do GI in this PR. Feel free to open another after if you're interested though. To get this PR merged, I want to test this on some more realistic scenes and check how the perf/quality compares. If it's always better than the existing method, then imo we should remove the existing method and maintain just this one. That's basically the only blocker. Unfortunately I don't have a desktop for the next week or two to be able to run Sponza and other scenes. There's also the opportunity here to change the denoiser/downscale depth/noise patterns that I copied from XeGTAO, and try what the newer vismask impls are using. Up to you on that, we can also leave the existing ones as-is. |
@@ -347,13 +392,22 @@ impl FromWorld for SsaoPipelines { | |||
address_mode_v: AddressMode::ClampToEdge, | |||
..Default::default() | |||
}); | |||
let linear_point_clamp_sampler = render_device.create_sampler(&SamplerDescriptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other sampler is called point because it's a nearest sampler. I guess this is still using nearest for the mips.
The code behind the vismask paper was open sourced (NOTE: Parts, including the denoiser, are from Unity and are not open-source licensed, be careful which files you reference): https://github.com/cdrinmatane/SSRT3 |
I'm still quite busy with meshlets, but I need to find some time sometime soon to try this PR out and see how it compares to GTAO. |
Early implementation. I still have to fix the documentation and consider writing a small migration guide.
Questions left to answer:
Eq
/Hash
forSSAOMethod
?