浏览代码

Fix bug with isReady and Shadermaterial

David Catuhe 7 年之前
父节点
当前提交
28d6658f56
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/Mesh/babylon.mesh.ts

+ 9 - 2
src/Mesh/babylon.mesh.ts

@@ -639,8 +639,15 @@
                     for (var subMesh of this.subMeshes) {
                         let effectiveMaterial = subMesh.getMaterial();
                         if (effectiveMaterial) {
-                            if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
-                                return false;
+                            if (effectiveMaterial.storeEffectOnSubMeshes) {
+                                if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
+                                    return false;
+                                } 
+                            }
+                            else {
+                                if (!effectiveMaterial.isReady(this, hardwareInstancedRendering)) {
+                                    return false;
+                                }
                             }
                         }
                     }