소스 검색

Fix delay bug with RTT

David Catuhe 7 년 전
부모
커밋
7a295b7dd0

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 14928 - 14928
Playground/babylon.d.txt


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4403 - 4403
dist/preview release/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
dist/preview release/babylon.js


+ 1 - 2
dist/preview release/babylon.max.js

@@ -58913,8 +58913,7 @@ var BABYLON;
             for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
                 var mesh = currentRenderList[meshIndex];
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
dist/preview release/babylon.worker.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 9772 - 9772
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 4 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -10593,7 +10593,6 @@ var BABYLON;
                                         break;
                                 }
                             }
-                            break;
                         }
                     }
                 }
@@ -54864,6 +54863,9 @@ var BABYLON;
                 return this._sourceMesh.renderingGroupId;
             },
             set: function (value) {
+                if (!this._sourceMesh || value === this._sourceMesh.renderingGroupId) {
+                    return;
+                }
                 //no-op with warning
                 BABYLON.Tools.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");
             },
@@ -58213,8 +58215,7 @@ var BABYLON;
             for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
                 var mesh = currentRenderList[meshIndex];
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

+ 4 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -10566,7 +10566,6 @@ var BABYLON;
                                         break;
                                 }
                             }
-                            break;
                         }
                     }
                 }
@@ -54837,6 +54836,9 @@ var BABYLON;
                 return this._sourceMesh.renderingGroupId;
             },
             set: function (value) {
+                if (!this._sourceMesh || value === this._sourceMesh.renderingGroupId) {
+                    return;
+                }
                 //no-op with warning
                 BABYLON.Tools.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");
             },
@@ -58186,8 +58188,7 @@ var BABYLON;
             for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
                 var mesh = currentRenderList[meshIndex];
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

+ 1 - 2
dist/preview release/es6.js

@@ -58886,8 +58886,7 @@ var BABYLON;
             for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
                 var mesh = currentRenderList[meshIndex];
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 5 - 5
dist/preview release/viewer/babylon.viewer.js


+ 4 - 3
dist/preview release/viewer/babylon.viewer.max.js

@@ -10676,7 +10676,6 @@ var BABYLON;
                                         break;
                                 }
                             }
-                            break;
                         }
                     }
                 }
@@ -55645,6 +55644,9 @@ var BABYLON;
                 return this._sourceMesh.renderingGroupId;
             },
             set: function (value) {
+                if (!this._sourceMesh || value === this._sourceMesh.renderingGroupId) {
+                    return;
+                }
                 //no-op with warning
                 BABYLON.Tools.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");
             },
@@ -58994,8 +58996,7 @@ var BABYLON;
             for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
                 var mesh = currentRenderList[meshIndex];
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -1156,7 +1156,7 @@
             // Detect if we are running on a faulty buggy desktop OS.
             this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 
-            Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched");
+            console.log("Babylon.js engine (v" + Engine.Version + ") launched");
 
             this.enableOfflineSupport = (Database !== undefined);
         }

+ 1 - 2
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -474,8 +474,7 @@
                 var mesh = currentRenderList[meshIndex];
 
                 if (mesh) {
-                    if (!mesh.isReady()) {
-                        // Reset _currentRefreshId
+                    if (!mesh.isReady(this.refreshRate === 0)) {
                         this.resetRefreshCounter();
                         continue;
                     }

+ 6 - 0
src/Particles/babylon.IParticleSystem.ts

@@ -165,5 +165,11 @@ module BABYLON {
          * Remove all active particles
          */
         reset(): void;
+
+        /**
+         * Is this system ready to be used/rendered
+         * @return true if the system is ready
+         */
+        isReady(): boolean;        
     }
 }

+ 13 - 1
src/Particles/babylon.gpuParticleSystem.ts

@@ -258,6 +258,18 @@
         }
 
         /**
+         * Is this system ready to be used/rendered
+         * @return true if the system is ready
+         */
+        public isReady(): boolean {
+            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+                return false;
+            }
+
+            return true;
+        }        
+
+        /**
          * Gets Wether the system has been started.
          * @returns True if it has been started, otherwise false.
          */
@@ -505,7 +517,7 @@
             this._recreateUpdateEffect();
             this._recreateRenderEffect();
 
-            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() ) {
+            if (!this.isReady()) {
                 return 0;
             }
 

+ 15 - 2
src/Particles/babylon.particleSystem.ts

@@ -847,6 +847,19 @@
         }
 
         /**
+         * Is this system ready to be used/rendered
+         * @return true if the system is ready
+         */
+        public isReady(): boolean {
+            var effect = this._getEffect();
+            if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+                return false;
+            }
+
+            return true;
+        }
+
+        /**
          * Renders the particle system in its current state.
          * @returns the current number of particles
          */
@@ -854,7 +867,7 @@
             var effect = this._getEffect();
 
             // Check
-            if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length) {
+            if (!this.isReady() || !this._particles.length) {
                 return 0;
             }
 
@@ -869,7 +882,7 @@
             effect.setMatrix("view", viewMatrix);
             effect.setMatrix("projection", this._scene.getProjectionMatrix());
 
-            if (this._isAnimationSheetEnabled) {
+            if (this._isAnimationSheetEnabled && this.particleTexture) {
                 var baseSize = this.particleTexture.getBaseSize();
                 effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth);
             }

+ 8 - 1
src/babylon.scene.ts

@@ -1937,6 +1937,13 @@
                 }
             }
 
+            // Particles
+            for (var particleSystem of this.particleSystems) {
+                if (!particleSystem.isReady()) {
+                    return false;
+                }
+            }
+
             return true;
         }
 
@@ -3205,7 +3212,7 @@
             if (this.textures) {
                 for (let i = 0; i < this.textures.length; i++) {
                     let texture = this.textures[i];
-                    if (texture && texture.isRenderTarget) {
+                    if (texture && texture.renderList) {
                         (<RenderTargetTexture>texture).freeRenderingGroups();
                     }
                 }

BIN
tests/validation/ReferenceImages/particles.png


+ 7 - 0
tests/validation/config.json

@@ -309,6 +309,13 @@
       "referenceImage": "pbrrough.png"
     },
     {
+      "title": "Particles",
+      "renderCount": 100,
+      "scriptToRun": "/Demos/Particles/particles.js",
+      "functionToCall": "CreateParticlesTestScene",
+      "referenceImage": "particles.png"
+    },    
+    {
       "title": "Reflection probes",
       "renderCount": 20,
       "scriptToRun": "/Demos/RefProbe/reflectionProbe.js",