diff options
author | Joan Fons <joan.fonssanchez@gmail.com> | 2021-10-26 15:37:22 +0200 |
---|---|---|
committer | Joan Fons <joan.fonssanchez@gmail.com> | 2021-10-26 15:37:22 +0200 |
commit | 95bc9c40d926012caf0ea744977231c4d6e286ed (patch) | |
tree | 6de300fbe8c3b00cd77d972fe75aac6567db659e /servers/rendering | |
parent | c2640e2b212d93cfe1264719360b56f020bf15ca (diff) |
Fix shadow disabling on mobile renderer
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl index 0ee68d5e10..2b59e85e4f 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl @@ -1046,7 +1046,7 @@ void main() { #if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) if (!sc_disable_directional_lights) { //directional light - +#ifndef SHADOWS_DISABLED // Do shadow and lighting in two passes to reduce register pressure uint shadow0 = 0; uint shadow1 = 0; @@ -1322,6 +1322,8 @@ void main() { } } +#endif // SHADOWS_DISABLED + for (uint i = 0; i < 8; i++) { if (i >= scene_data.directional_light_count) { break; @@ -1334,13 +1336,13 @@ void main() { // We're not doing light transmittence float shadow = 1.0; - +#ifndef SHADOWS_DISABLED if (i < 4) { shadow = float(shadow0 >> (i * 8) & 0xFF) / 255.0; } else { shadow = float(shadow1 >> ((i - 4) * 8) & 0xFF) / 255.0; } - +#endif blur_shadow(shadow); light_compute(normal, directional_lights.data[i].direction, normalize(view), 0.0, directional_lights.data[i].color * directional_lights.data[i].energy, shadow, f0, orms, 1.0, |