Merge pull request #66107 from devloglogan/ambient-light-disabled-fix
Fix ambient_light_disabled render mode flag
This commit is contained in:
commit
0d711cad30
3 changed files with 28 additions and 13 deletions
|
@ -1129,9 +1129,15 @@ void main() {
|
||||||
#if defined(CUSTOM_IRRADIANCE_USED)
|
#if defined(CUSTOM_IRRADIANCE_USED)
|
||||||
ambient_light = mix(ambient_light, custom_irradiance.rgb, custom_irradiance.a);
|
ambient_light = mix(ambient_light, custom_irradiance.rgb, custom_irradiance.a);
|
||||||
#endif // CUSTOM_IRRADIANCE_USED
|
#endif // CUSTOM_IRRADIANCE_USED
|
||||||
ambient_light *= albedo.rgb;
|
|
||||||
|
|
||||||
|
{
|
||||||
|
#if defined(AMBIENT_LIGHT_DISABLED)
|
||||||
|
ambient_light = vec3(0.0, 0.0, 0.0);
|
||||||
|
#else
|
||||||
|
ambient_light *= albedo.rgb;
|
||||||
ambient_light *= ao;
|
ambient_light *= ao;
|
||||||
|
#endif // AMBIENT_LIGHT_DISABLED
|
||||||
|
}
|
||||||
|
|
||||||
// convert ao to direct light ao
|
// convert ao to direct light ao
|
||||||
ao = mix(1.0, ao, ao_light_affect);
|
ao = mix(1.0, ao, ao_light_affect);
|
||||||
|
|
|
@ -1447,17 +1447,20 @@ void fragment_shader(in SceneData scene_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//finalize ambient light here
|
//finalize ambient light here
|
||||||
|
{
|
||||||
|
#if defined(AMBIENT_LIGHT_DISABLED)
|
||||||
|
ambient_light = vec3(0.0, 0.0, 0.0);
|
||||||
|
#else
|
||||||
ambient_light *= albedo.rgb;
|
ambient_light *= albedo.rgb;
|
||||||
ambient_light *= ao;
|
ambient_light *= ao;
|
||||||
|
|
||||||
// convert ao to direct light ao
|
if (bool(scene_data.ss_effects_flags & SCREEN_SPACE_EFFECTS_FLAGS_USE_SSIL)) {
|
||||||
ao = mix(1.0, ao, ao_light_affect);
|
|
||||||
|
|
||||||
if (bool(implementation_data.ss_effects_flags & SCREEN_SPACE_EFFECTS_FLAGS_USE_SSIL)) {
|
|
||||||
vec4 ssil = textureLod(sampler2D(ssil_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv, 0.0);
|
vec4 ssil = textureLod(sampler2D(ssil_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv, 0.0);
|
||||||
ambient_light *= 1.0 - ssil.a;
|
ambient_light *= 1.0 - ssil.a;
|
||||||
ambient_light += ssil.rgb * albedo.rgb;
|
ambient_light += ssil.rgb * albedo.rgb;
|
||||||
}
|
}
|
||||||
|
#endif // AMBIENT_LIGHT_DISABLED
|
||||||
|
}
|
||||||
|
|
||||||
//this saves some VGPRs
|
//this saves some VGPRs
|
||||||
vec3 f0 = F0(metallic, specular, albedo);
|
vec3 f0 = F0(metallic, specular, albedo);
|
||||||
|
|
|
@ -1172,8 +1172,14 @@ void main() {
|
||||||
} //Reflection probes
|
} //Reflection probes
|
||||||
|
|
||||||
// finalize ambient light here
|
// finalize ambient light here
|
||||||
|
{
|
||||||
|
#if defined(AMBIENT_LIGHT_DISABLED)
|
||||||
|
ambient_light = vec3(0.0, 0.0, 0.0);
|
||||||
|
#else
|
||||||
ambient_light *= albedo.rgb;
|
ambient_light *= albedo.rgb;
|
||||||
ambient_light *= ao;
|
ambient_light *= ao;
|
||||||
|
#endif // AMBIENT_LIGHT_DISABLED
|
||||||
|
}
|
||||||
|
|
||||||
// convert ao to direct light ao
|
// convert ao to direct light ao
|
||||||
ao = mix(1.0, ao, ao_light_affect);
|
ao = mix(1.0, ao, ao_light_affect);
|
||||||
|
|
Loading…
Reference in a new issue