Browse Source

avoid depth texture error when material needs alpha testing but doesnt have alpha texture

Trevor Baron 7 years ago
parent
commit
6283bf2a8a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Rendering/babylon.depthRenderer.ts

+ 1 - 1
src/Rendering/babylon.depthRenderer.ts

@@ -133,7 +133,7 @@
             var mesh = subMesh.getMesh();
 
             // Alpha test
-            if (material && material.needAlphaTesting()) {
+            if (material && material.needAlphaTesting() && material.getAlphaTestTexture()) {
                 defines.push("#define ALPHATEST");
                 if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {
                     attribs.push(VertexBuffer.UVKind);