David `Deltakosh` Catuhe 5 years ago
parent
commit
80ab7a1fb9
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Lights/Shadows/shadowGenerator.ts

+ 5 - 0
src/Lights/Shadows/shadowGenerator.ts

@@ -1330,6 +1330,11 @@ export class ShadowGenerator implements IShadowGenerator {
             if (material && material.needAlphaTesting()) {
             if (material && material.needAlphaTesting()) {
                 var alphaTexture = material.getAlphaTestTexture();
                 var alphaTexture = material.getAlphaTestTexture();
                 if (alphaTexture) {
                 if (alphaTexture) {
+
+                    if (!alphaTexture.isReady()) {
+                        return false;
+                    }
+
                     defines.push("#define ALPHATEST");
                     defines.push("#define ALPHATEST");
                     if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {
                     if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {
                         attribs.push(VertexBuffer.UVKind);
                         attribs.push(VertexBuffer.UVKind);