浏览代码

block dirty

Julien Barrois 6 年之前
父节点
当前提交
f1d9c9f53b
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/Materials/babylon.material.ts

+ 8 - 0
src/Materials/babylon.material.ts

@@ -1172,6 +1172,10 @@ module BABYLON {
          * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
          */
         public markAsDirty(flag: number): void {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+
             Material._callbackArray.length = 0;
 
             if (flag & Material.TextureDirtyFlag) {
@@ -1207,6 +1211,10 @@ module BABYLON {
          * @param func defines a function which checks material defines against the submeshes
          */
         protected _markAllSubMeshesAsDirty(func: (defines: MaterialDefines) => void) {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+
             const meshes = this.getScene().meshes;
             for (var mesh of meshes) {
                 if (!mesh.subMeshes) {