浏览代码

Better forceCompilation

David Catuhe 5 年之前
父节点
当前提交
cf899b30dd
共有 1 个文件被更改,包括 9 次插入21 次删除
  1. 9 21
      src/Materials/material.ts

+ 9 - 21
src/Materials/material.ts

@@ -1070,27 +1070,15 @@ export class Material implements IAnimatable {
                 var allDone = true, lastError = null;
                 if (mesh.subMeshes) {
                     let tempSubMesh = new SubMesh(0, 0, 0, 0, 0, mesh, undefined, false, false);
-                    if (this._storeEffectOnSubMeshes) {
-                        if (tempSubMesh._materialDefines) {
-                            tempSubMesh._materialDefines._renderId = -1;
-                        }
-                        if (!this.isReadyForSubMesh(mesh, tempSubMesh, localOptions.useInstances)) {
-                            if (tempSubMesh.effect && tempSubMesh.effect.getCompilationError() && tempSubMesh.effect.allFallbacksProcessed()) {
-                                lastError = tempSubMesh.effect.getCompilationError();
-                            } else {
-                                allDone = false;
-                                setTimeout(checkReady, 16);
-                            }
-                        }
-                    } else {
-                        tempSubMesh._renderId = -1;
-                        if (!this.isReady(mesh, localOptions.useInstances)) {
-                            if (this.getEffect() && this.getEffect()!.getCompilationError() && this.getEffect()!.allFallbacksProcessed()) {
-                                lastError = this.getEffect()!.getCompilationError();
-                            } else {
-                                allDone = false;
-                                setTimeout(checkReady, 16);
-                            }
+                    if (tempSubMesh._materialDefines) {
+                        tempSubMesh._materialDefines._renderId = -1;
+                    }
+                    if (!this.isReadyForSubMesh(mesh, tempSubMesh, localOptions.useInstances)) {
+                        if (tempSubMesh.effect && tempSubMesh.effect.getCompilationError() && tempSubMesh.effect.allFallbacksProcessed()) {
+                            lastError = tempSubMesh.effect.getCompilationError();
+                        } else {
+                            allDone = false;
+                            setTimeout(checkReady, 16);
                         }
                     }
                 }