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

"Ao Channel Affect" defaults to 0, giving unexpected results (fixed in master via different AO calculation) #43957

Open
Arnklit opened this issue Nov 29, 2020 · 3 comments

Comments

@Arnklit
Copy link
Contributor

Arnklit commented Nov 29, 2020

Godot version:
3.2.3.Stable

OS/device including version:
NA

Issue description:
"Ao Channel Affect" defaults to 0, giving unexpected results. This means that as soon as you set an AO texture on a material, there will no longer be SSAO on that material. When this happened to me I assumed it was simply a limitation of the engine and on purpose. I think we should default that setting to 1. From talking to other Godot users I know others have thought that you couldn't use SSAO and AO textures at the same time because of this.

I'm also wondering if "Ao Channel Affect" is actually doing the correct thing. Currently it's controlling how much the SSAO can influence the AO maps, but it feels more logical that it would be how much the the AO maps are allowed to influence the SSAO.

image

Steps to reproduce:
Open the attached project to the see issue.

Minimal reproduction project:
ssao_aompap_issue.zip

@Calinou
Copy link
Member

Calinou commented Nov 29, 2020

I think the AO texture system in Godot was initially designed to be used on 3D meshes where you don't want SSAO to be applied. Otherwise, the occlusion will be twice as strong as originally intended.

For "world" materials (such as level materials), you should definitely set Ao Channel Affect to 1. For "model" materials (such as a vehicle or a character), it makes sense to leave it to 0.

@Arnklit
Copy link
Contributor Author

Arnklit commented Nov 29, 2020

Yeah I sort of figured that was the idea. The example of an AO texture in the manual is also for larger shapes with an AO texture applied, but that's not really how AO textures are used in modern game engines, they are baked out to add the small details that cannot be captured by SSAO.

But I don't think it should be a problem that the occlusion get's "twice as strong". if the blend mode is correct it should take whatever was darkest between the SSAO and texture I assume?

Calinou added a commit to Calinou/godot that referenced this issue Nov 29, 2020
"Ao Channel Affect" was defaulting to 0, giving unexpected results.
This meant that as soon as you set an AO texture on a material,
there will no longer be SSAO on that material.

This led many users to think that Godot didn't support using
SSAO and AO textures at the same time.

This closes godotengine#43957.
@Calinou
Copy link
Member

Calinou commented Jun 8, 2021

This was fixed by #45023 in the master branch.

While this is technically a breaking change, I wonder if we should change the default value in 3.x considering the default behavior is pretty much useless. Alternatively, we can backport the AO change from master to 3.x instead. This would be for 3.4 or later, not 3.3.x.

@Calinou Calinou added this to the 3.4 milestone Jun 8, 2021
@Calinou Calinou changed the title "Ao Channel Affect" defaults to 0, giving unexpected results "Ao Channel Affect" defaults to 0, giving unexpected results (fixed in master via different AO calculation) Jun 8, 2021
@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
@KoBeWi KoBeWi modified the milestones: 3.5, 3.x Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants