diff --git a/modules/core/src/shaderlib/shadow/shadow.ts b/modules/core/src/shaderlib/shadow/shadow.ts index 6bbcb62c2a0..ca16bed8881 100644 --- a/modules/core/src/shaderlib/shadow/shadow.ts +++ b/modules/core/src/shaderlib/shadow/shadow.ts @@ -234,12 +234,11 @@ function createShadowUniforms( for (let i = 0; i < viewProjectionMatrices.length; i++) { uniforms[`shadow_uViewProjectionMatrices[${i}]`] = viewProjectionMatrices[i]; uniforms[`shadow_uProjectCenters[${i}]`] = projectCenters[i]; + } - if (opts.shadowMaps && opts.shadowMaps.length > 0) { - uniforms[`shadow_uShadowMap${i}`] = opts.shadowMaps[i]; - } else { - uniforms[`shadow_uShadowMap${i}`] = opts.dummyShadowMap; - } + for (let i = 0; i < 2; i++) { + uniforms[`shadow_uShadowMap${i}`] = + (opts.shadowMaps && opts.shadowMaps[i]) || opts.dummyShadowMap; } return uniforms; }