Merge pull request #54265 from JFonS/fix_sh_dis_mobile

This commit is contained in:
Rémi Verschelde 2021-10-26 16:50:11 +02:00 committed by GitHub
commit 46a139a3ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,