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

[3.x] Add a setting to reduce dark SSAO artifacts when the camera gets close to materials #53785

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 13, 2021

Follow-up to #53784.

This setting clamps final SSAO intensity. With this setting correctly configured, SSAO artifacts will still occur, but they'll be much less noticeable.

The default value is 1.0, which means the existing behavior is unchanged.

This closes godotengine/godot-proposals#3720.

Testing project: test_ssao_3_3.x.zip

Preview

ssao-max-obscurance-setting.mp4

Scene 1

Before After (Max Obscurance = 0.5)
2021-10-14_00 53 35 2021-10-14_01 00 20

Scene 2

Before After (Max Obscurance = 0.5)
2021-10-14_01 03 01 2021-10-14_01 02 44

@Calinou Calinou requested a review from a team as a code owner October 13, 2021 23:05
@Calinou Calinou added this to the 3.4 milestone Oct 13, 2021
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

I think users should be able to set their AO to black if they want.

We should solve the bug that causes SSAO to become unnecessarily dark when the camera approaches a surface instead.

If you are only interested in a stopgap solution, then a configurable max should be exposed like in 4.0:

obscurance = min(obscurance, params.shadow_clamp);

note: in the attached code, we are dealing with obscurance so a min function is used

@Calinou Calinou changed the title Reduce dark SSAO artifacts when the camera gets close to materials Add a setting to reduce dark SSAO artifacts when the camera gets close to materials Oct 14, 2021
@Calinou
Copy link
Member Author

Calinou commented Oct 14, 2021

If you are only interested in a stopgap solution, then a configurable max should be exposed like in 4.0:

I added a setting for this. It requires increasing the number of binder arguments from 13 to 14, which means the diff is large compared to the feature itself.

…e to materials

This setting clamps final SSAO intensity.
With this setting correctly configured, SSAO artifacts will still occur,
but they'll be much less noticeable.
@Calinou Calinou force-pushed the ssao-fix-dark-close-artifacts branch from d7998e2 to 33f3c12 Compare June 27, 2023 07:40
@akien-mga akien-mga changed the title Add a setting to reduce dark SSAO artifacts when the camera gets close to materials [3.x] Add a setting to reduce dark SSAO artifacts when the camera gets close to materials Jun 27, 2023
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.

None yet

3 participants