Ver código fonte

Simplify _markSubMeshesAsMiscDirty and avoid doing loop over all meshes in scene

Popov72 5 anos atrás
pai
commit
f61e4d1ea0
1 arquivos alterados com 1 adições e 10 exclusões
  1. 1 10
      src/Meshes/abstractMesh.ts

+ 1 - 10
src/Meshes/abstractMesh.ts

@@ -845,16 +845,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
     /** @hidden */
     public _markSubMeshesAsMiscDirty() {
-        if (!this.subMeshes) {
-            return;
-        }
-
-        for (var subMesh of this.subMeshes) {
-            var material = subMesh.getMaterial();
-            if (material) {
-                material.markAsDirty(Constants.MATERIAL_MiscDirtyFlag);
-            }
-        }
+        this._markSubMeshesAsDirty((defines) => defines.markAsMiscDirty());
     }
 
     /**