Explorar el Código

Merge pull request #2694 from CarlosLanderas/master

Check alpha texture exist before setting it in OutlineRenderer render…
David Catuhe hace 8 años
padre
commit
338c48be38
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      src/Rendering/babylon.outlineRenderer.ts

+ 5 - 3
src/Rendering/babylon.outlineRenderer.ts

@@ -38,14 +38,16 @@
             // Alpha test
             if (material && material.needAlphaTesting()) {
                 var alphaTexture = material.getAlphaTestTexture();
-                this._effect.setTexture("diffuseSampler", alphaTexture);
-                this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                if (alphaTexture) {
+                    this._effect.setTexture("diffuseSampler", alphaTexture);
+                    this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                }
             }
 
             engine.setZOffset(-this.zOffset);
 
             mesh._processRendering(subMesh, this._effect, Material.TriangleFillMode, batch, hardwareInstancedRendering,
-                (isInstance, world) => { this._effect.setMatrix("world", world)});
+                (isInstance, world) => { this._effect.setMatrix("world", world) });
 
             engine.setZOffset(0);
         }