Browse Source

Revert "Implicitly create renderingGroup when Observer are registered"

This reverts commit ba9f8fc88594abb419b1ab145e343cee906a7fda.
nockawa 8 years ago
parent
commit
e8d983ccef
1 changed files with 1 additions and 11 deletions
  1. 1 11
      src/Rendering/babylon.renderingManager.ts

+ 1 - 11
src/Rendering/babylon.renderingManager.ts

@@ -125,10 +125,6 @@
 
                 this._currentIndex = index;
 
-                if (observable && !renderingGroup) {
-                    renderingGroup = this._fetchRenderingGroup(index);
-                }
-
                 if (renderingGroup) {
                     let renderingGroupMask = 0;
 
@@ -195,12 +191,6 @@
             var mesh = subMesh.getMesh();
             var renderingGroupId = mesh.renderingGroupId || 0;
 
-            this._fetchRenderingGroup(renderingGroupId);
-
-            this._renderingGroups[renderingGroupId].dispatch(subMesh);
-        }
-
-        private _fetchRenderingGroup(renderingGroupId: number): RenderingGroup {
             if (!this._renderingGroups[renderingGroupId]) {
                 this._renderingGroups[renderingGroupId] = new RenderingGroup(renderingGroupId, this._scene,
                     this._customOpaqueSortCompareFn[renderingGroupId],
@@ -209,7 +199,7 @@
                 );
             }
 
-            return this._renderingGroups[renderingGroupId];
+            this._renderingGroups[renderingGroupId].dispatch(subMesh);
         }
 
         /**