浏览代码

Fix instance freezing mode

David Catuhe 6 年之前
父节点
当前提交
52ebe85529
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/Meshes/mesh.ts

+ 4 - 2
src/Meshes/mesh.ts

@@ -815,6 +815,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
      * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
      * - VertexBuffer.PositionKind
+     * - VertexBuffer.NormalKind
      * - VertexBuffer.UVKind
      * - VertexBuffer.UV2Kind
      * - VertexBuffer.UV3Kind
@@ -1544,8 +1545,6 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
     /** @hidden */
     public _freeze() {
-        this._instanceDataStorage.isFrozen = true;
-
         if (!this.subMeshes) {
             return;
         }
@@ -1554,6 +1553,9 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         for (var index = 0; index < this.subMeshes.length; index++) {
             this._getInstancesRenderList(index);
         }
+
+        this._effectiveMaterial = null;
+        this._instanceDataStorage.isFrozen = true;
     }
 
     /** @hidden */