Merge pull request #66107 from devloglogan/ambient-light-disabled-fix

Fix ambient_light_disabled render mode flag
This commit is contained in:
Clay John 2022-10-27 10:08:29 -07:00 committed by GitHub
commit 0d711cad30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 13 deletions

View file

@ -1129,9 +1129,15 @@ void main() {
#if defined(CUSTOM_IRRADIANCE_USED)
ambient_light = mix(ambient_light, custom_irradiance.rgb, custom_irradiance.a);
#endif // CUSTOM_IRRADIANCE_USED
ambient_light *= albedo.rgb;
ambient_light *= ao;
{
#if defined(AMBIENT_LIGHT_DISABLED)
ambient_light = vec3(0.0, 0.0, 0.0);
#else
ambient_light *= albedo.rgb;
ambient_light *= ao;
#endif // AMBIENT_LIGHT_DISABLED
}
// convert ao to direct light ao
ao = mix(1.0, ao, ao_light_affect);