diff options
author | Logan Lang <devloglogan@gmail.com> | 2022-09-19 08:27:42 -0500 |
---|---|---|
committer | Logan Lang <devloglogan@gmail.com> | 2022-09-19 17:12:32 -0500 |
commit | e61d8b6f530923095c0990cd04920e4a024a6da0 (patch) | |
tree | 127bd6bb7383222af856791a3b9fea9ed6032c96 /servers | |
parent | 63c0dc690e06731224e88911ed16d1b798b681b5 (diff) |
enabled ambient_light_disabled render mode flag
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl | 21 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl | 10 |
2 files changed, 20 insertions, 11 deletions
diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index d41474118d..a330fd5497 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -1374,16 +1374,19 @@ void fragment_shader(in SceneData scene_data) { } //finalize ambient light here - ambient_light *= albedo.rgb; - ambient_light *= ao; - - // convert ao to direct light ao - ao = mix(1.0, ao, ao_light_affect); + { +#if defined(AMBIENT_LIGHT_DISABLED) + ambient_light = vec3(0.0, 0.0, 0.0); +#else + ambient_light *= albedo.rgb; + ambient_light *= ao; - 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); - ambient_light *= 1.0 - ssil.a; - ambient_light += ssil.rgb * albedo.rgb; + if (bool(scene_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); + ambient_light *= 1.0 - ssil.a; + ambient_light += ssil.rgb * albedo.rgb; + } +#endif // AMBIENT_LIGHT_DISABLED } //this saves some VGPRs diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index a109fd4d75..d42fdc8746 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -1100,8 +1100,14 @@ void main() { } //Reflection probes // finalize ambient light here - 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); |