فهرست منبع

Check alpha texture exist before setting it in OutlineRenderer render method

Carlos Landeras Martínez 8 سال پیش
والد
کامیت
bc2ce8c78b
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  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);
         }