Quellcode durchsuchen

Fixed issue with instances and viewport

David Catuhe vor 8 Jahren
Ursprung
Commit
7633b42ed1

Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 21
dist/preview release/babylon.core.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2888 - 2884
dist/preview release/babylon.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 26 - 26
dist/preview release/babylon.js


Datei-Diff unterdrückt, da er zu groß ist
+ 7 - 5
dist/preview release/babylon.max.js


Datei-Diff unterdrückt, da er zu groß ist
+ 26 - 26
dist/preview release/babylon.noworker.js


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

@@ -48,6 +48,7 @@ Usefull if a mesh has multiple animations. ([agallouin](https://github.com/AGall
 ### API doc
 
 ### Bug fixes
+- Fixed issue with instancse and viewports ([deltakosh](https://github.com/deltakosh))
 - Fixed issue with FreeCamera not working in fullscreen or when pointer locked ([abow](https://github.com/abow))
 - MapTexture: Font Characters are now correctly aligned on Chrome ([nockawa](https://github.com/nockawa))
 - Fixed some missing parameter default values in `MeshBuilder.CreateGroundFromHeightMap()` and `MeshBuilder.CreateTiledGround()` ([jerome](https://github.com/jbousquie))

+ 6 - 2
src/Layer/babylon.highlightlayer.js

@@ -57,6 +57,10 @@ var BABYLON;
              */
             this.outerGlow = true;
             /**
+             * Specifies wether the highlight layer is enabled or not.
+             */
+            this.isEnabled = true;
+            /**
              * An event triggered when the highlight layer has been disposed.
              * @type {BABYLON.Observable}
              */
@@ -307,7 +311,7 @@ var BABYLON;
          * @return true if ready otherwise, false
          */
         HighlightLayer.prototype.isReady = function (subMesh, useInstances, emissiveTexture) {
-            if (!subMesh.getMaterial().isReady()) {
+            if (!subMesh.getMaterial().isReady(subMesh.getMesh(), useInstances)) {
                 return false;
             }
             var defines = [];
@@ -521,7 +525,7 @@ var BABYLON;
          * Returns true if the layer contains information to display, otherwise false.
          */
         HighlightLayer.prototype.shouldRender = function () {
-            return this._shouldRender;
+            return this.isEnabled && this._shouldRender;
         };
         /**
          * Sets the main texture desired size which is the closest power of two

+ 0 - 2
src/babylon.scene.js

@@ -2055,9 +2055,7 @@ var BABYLON;
             this.postProcessRenderPipelineManager.update();
             // Multi-cameras?
             if (this.activeCameras.length > 0) {
-                var currentRenderId = this._renderId;
                 for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
-                    this._renderId = currentRenderId;
                     if (cameraIndex > 0) {
                         this._engine.clear(0, false, true, true);
                     }

+ 0 - 2
src/babylon.scene.ts

@@ -2456,9 +2456,7 @@
 
             // Multi-cameras?
             if (this.activeCameras.length > 0) {
-                var currentRenderId = this._renderId;
                 for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
-                    this._renderId = currentRenderId;
                     if (cameraIndex > 0) {
                         this._engine.clear(0, false, true, true);
                     }