Explorar o código

Fixed issue with Instancing, edges rendering and LOD

David Catuhe %!s(int64=9) %!d(string=hai) anos
pai
achega
1279fb7cf5

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/babylon.core.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 8508 - 8508
dist/preview release/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/babylon.js


+ 6 - 6
dist/preview release/babylon.max.js

@@ -16564,7 +16564,7 @@ var BABYLON;
                     this._activeMeshes.push(mesh);
                     this.activeCamera._activeMeshes.push(mesh);
                     mesh._activate(this._renderId);
-                    this._activeMesh(meshLOD);
+                    this._activeMesh(mesh, meshLOD);
                 }
             }
             // Particle systems
@@ -16586,7 +16586,7 @@ var BABYLON;
             }
             this._particlesDuration.endMonitoring(false);
         };
-        Scene.prototype._activeMesh = function (mesh) {
+        Scene.prototype._activeMesh = function (sourceMesh, mesh) {
             if (mesh.skeleton && this.skeletonsEnabled) {
                 if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
                     mesh.skeleton.prepare();
@@ -16595,11 +16595,11 @@ var BABYLON;
                     this._softwareSkinnedMeshes.pushNoDuplicate(mesh);
                 }
             }
-            if (mesh.showBoundingBox || this.forceShowBoundingBoxes) {
-                this._boundingBoxRenderer.renderList.push(mesh.getBoundingInfo().boundingBox);
+            if (sourceMesh.showBoundingBox || this.forceShowBoundingBoxes) {
+                this._boundingBoxRenderer.renderList.push(sourceMesh.getBoundingInfo().boundingBox);
             }
-            if (mesh._edgesRenderer) {
-                this._edgesRenderers.push(mesh._edgesRenderer);
+            if (sourceMesh._edgesRenderer) {
+                this._edgesRenderers.push(sourceMesh._edgesRenderer);
             }
             if (mesh && mesh.subMeshes) {
                 // Submeshes Octrees

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/babylon.noworker.js


+ 1 - 0
dist/preview release/what's new.md

@@ -31,6 +31,7 @@
 - Fixed model shape initial red vertex color set to zero not formerly being taken in account in the `SolidParticleSystem` ([jerome](https://github.com/jbousquie))
 - Fixed RenderTargetTexture meshes selection ([deltakosh](https://github.com/deltakosh))
 - Fixed camera speed computation ([deltakosh](https://github.com/deltakosh))
+- Fixed bug with isntances, LOD and edgesRendering ([deltakosh](https://github.com/deltakosh))
 - Canvas2D: ([nockawa](https://github.com/nockawa))
  - `WorldSpaceCanvas2D`:
 	- Intersection/interaction now works on non squared canvas

+ 6 - 6
src/babylon.scene.js

@@ -1595,7 +1595,7 @@ var BABYLON;
                     this._activeMeshes.push(mesh);
                     this.activeCamera._activeMeshes.push(mesh);
                     mesh._activate(this._renderId);
-                    this._activeMesh(meshLOD);
+                    this._activeMesh(mesh, meshLOD);
                 }
             }
             // Particle systems
@@ -1617,7 +1617,7 @@ var BABYLON;
             }
             this._particlesDuration.endMonitoring(false);
         };
-        Scene.prototype._activeMesh = function (mesh) {
+        Scene.prototype._activeMesh = function (sourceMesh, mesh) {
             if (mesh.skeleton && this.skeletonsEnabled) {
                 if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
                     mesh.skeleton.prepare();
@@ -1626,11 +1626,11 @@ var BABYLON;
                     this._softwareSkinnedMeshes.pushNoDuplicate(mesh);
                 }
             }
-            if (mesh.showBoundingBox || this.forceShowBoundingBoxes) {
-                this._boundingBoxRenderer.renderList.push(mesh.getBoundingInfo().boundingBox);
+            if (sourceMesh.showBoundingBox || this.forceShowBoundingBoxes) {
+                this._boundingBoxRenderer.renderList.push(sourceMesh.getBoundingInfo().boundingBox);
             }
-            if (mesh._edgesRenderer) {
-                this._edgesRenderers.push(mesh._edgesRenderer);
+            if (sourceMesh._edgesRenderer) {
+                this._edgesRenderers.push(sourceMesh._edgesRenderer);
             }
             if (mesh && mesh.subMeshes) {
                 // Submeshes Octrees

+ 6 - 6
src/babylon.scene.ts

@@ -1888,7 +1888,7 @@
                     this.activeCamera._activeMeshes.push(mesh);
                     mesh._activate(this._renderId);
 
-                    this._activeMesh(meshLOD);
+                    this._activeMesh(mesh, meshLOD);
                 }
             }
 
@@ -1914,7 +1914,7 @@
             this._particlesDuration.endMonitoring(false);
         }
 
-        private _activeMesh(mesh: AbstractMesh): void {
+        private _activeMesh(sourceMesh:AbstractMesh, mesh: AbstractMesh): void {
             if (mesh.skeleton && this.skeletonsEnabled) {
                 if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
                     mesh.skeleton.prepare();
@@ -1925,12 +1925,12 @@
                 }
             }
 
-            if (mesh.showBoundingBox || this.forceShowBoundingBoxes) {
-                this._boundingBoxRenderer.renderList.push(mesh.getBoundingInfo().boundingBox);
+            if (sourceMesh.showBoundingBox || this.forceShowBoundingBoxes) {
+                this._boundingBoxRenderer.renderList.push(sourceMesh.getBoundingInfo().boundingBox);
             }
 
-            if (mesh._edgesRenderer) {
-                this._edgesRenderers.push(mesh._edgesRenderer);
+            if (sourceMesh._edgesRenderer) {
+                this._edgesRenderers.push(sourceMesh._edgesRenderer);
             }
 
             if (mesh && mesh.subMeshes) {