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

Screen space ambient occlusion should only affect indirect light #4844

Closed
animech-sijo opened this issue Nov 14, 2022 · 1 comment · Fixed by #6907
Closed

Screen space ambient occlusion should only affect indirect light #4844

animech-sijo opened this issue Nov 14, 2022 · 1 comment · Fixed by #6907
Assignees
Labels
area: graphics Graphics related issue feature

Comments

@animech-sijo
Copy link

The post process AO added in #3266 is much needed. However, it naively multiplies the AO with the final image (gl_FragColor.rgb = inCol.rgb * ssao;)

This is a problem when using realtime lights, since lit and shadowed areas are darkened equally by the AO:
SSAO

Compare this to using baked AO textures in the ambient slot (in which lighting is calculated correctly):
BakedAO

SSAO should behave the same way AO textures do. The current behavior produces results that look "dirty".

@mvaligursky
Copy link
Contributor

Yes, we discussed both approaches, but at the end decided to implement it as a post-process (with the mentioned limitation) as a more performant solution. In this case, the scene is rendered, and its depth buffer is used to generates ssao, which is then blended into the scene.

The better solution, which we might do at some point in the future, renders the scene into depth buffer first. Then using this depth texture it generates ssao texture (this is the same step as the current implementation does). Then the whole scene is rendered again, while the ssao texture is used during the lighting computation. The extra cost here is having to re-render the scene one more time to have access to its depth before the scene with lighting is rendered.

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 a pull request may close this issue.

4 participants