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

Option to apply SSAO during lighting instead of during postprocessing #6907

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Sep 3, 2024

Fixes #4844
Try it here: https://engine-hx2mdhbb7-playcanvas.vercel.app/#/graphics/ambient-occlusion

Until now, the SSAO was applied as a post-processing effect. The problem is that the ambient occlusion then incorrectly darkens even the areas hit by lights.

For the render pass architecture, an option to apply AO during lighting in forward passes has been added.

Before - notice how uniformly the SSAO looks
Screenshot 2024-09-03 at 15 23 34

Now - almost no AO is visible in the lit areas, but ambient areas receive AO as before
Screenshot 2024-09-03 at 15 23 48

Detail before
Screenshot 2024-09-03 at 15 32 37

and now
Screenshot 2024-09-03 at 15 32 53

Detail before
Screenshot 2024-09-03 at 15 34 53

and now
Screenshot 2024-09-03 at 15 35 04

@mvaligursky mvaligursky self-assigned this Sep 3, 2024
@mvaligursky mvaligursky added feature area: graphics Graphics related issue labels Sep 3, 2024
@mvaligursky mvaligursky requested a review from a team September 3, 2024 14:36
@MAG-AdrianMeredith
Copy link
Contributor

Looks fantastic, there was always something "off" about the ssao that irked me and this is a huge improvement.
I've noticed a bug though if you apply scale its no longer aligned with the scene
image

@mvaligursky
Copy link
Contributor Author

this is a huge improvement

Totally agree, the impact is small but large at the same time.

I've noticed a bug though if you apply scale its no longer aligned with the scene

And I know exactly why .. will fix, thanks!

Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

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

finally!! <3

@mvaligursky mvaligursky merged commit ad00a02 into main Sep 4, 2024
8 checks passed
@mvaligursky mvaligursky deleted the mv-ssao-lighting branch September 4, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screen space ambient occlusion should only affect indirect light
3 participants