Просмотр исходного кода

Merge pull request #8038 from Popov72/fix-unbind-rtt

Fix bug on resizing + glow or highlight layer when multiple scenes
David Catuhe 5 лет назад
Родитель
Сommit
e3b0b9d9d3
3 измененных файлов с 6 добавлено и 3 удалено
  1. 1 0
      dist/preview release/what's new.md
  2. 4 3
      src/Layers/glowLayer.ts
  3. 1 0
      src/Layers/highlightLayer.ts

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

@@ -148,6 +148,7 @@
 - Fix bug in `ShaderMaterial` when using morph targets ([Popov72](https://github.com/Popov72)
 - Fix bug in playground where child NME windows would not close before page unload events ([belfortk](https://github.com/belfortk)
 - Fixed an issue with stereoscopic rendering ([#8000](https://github.com/BabylonJS/Babylon.js/issues/8000)) ([RaananW](https://github.com/RaananW))
+- Fix bug with multiple scenes when resizing the screen and there's a glow or highlight layer active ([Popov72](https://github.com/Popov72)
 - Fix an error when compiling with the closure compiler ([ageneau](https://github.com/ageneau/))
 - Fix an error in applying texture to sides of `extrudePolygon` using faceUV[1] ([JohnK](https://github.com/BabylonJSGuide/))
 

+ 4 - 3
src/Layers/glowLayer.ts

@@ -316,13 +316,14 @@ export class GlowLayer extends EffectLayer {
                     internalTexture,
                     true);
 
-                internalTexture = this._blurTexture2.getInternalTexture();
-                if (internalTexture) {
+                let internalTexture2 = this._blurTexture2.getInternalTexture();
+                if (internalTexture2) {
                     this._scene.postProcessManager.directRender(
                         this._postProcesses2,
-                        internalTexture,
+                        internalTexture2,
                         true);
                 }
+                this._engine.unBindFramebuffer(internalTexture2 ?? internalTexture, true);
             }
         });
 

+ 1 - 0
src/Layers/highlightLayer.ts

@@ -404,6 +404,7 @@ export class HighlightLayer extends EffectLayer {
                     this._postProcesses,
                     internalTexture,
                     true);
+                this._engine.unBindFramebuffer(internalTexture, true);
             }
 
             this.onAfterBlurObservable.notifyObservers(this);