Quellcode durchsuchen

do not skip updating rtt view ubo if multiple scenes are active

Trevor Baron vor 6 Jahren
Ursprung
Commit
1d74ceb5a0
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6 2
      src/Materials/Textures/renderTargetTexture.ts

+ 6 - 2
src/Materials/Textures/renderTargetTexture.ts

@@ -584,7 +584,10 @@ export class RenderTargetTexture extends Texture {
      */
     public render(useCameraPostProcess: boolean = false, dumpForDebug: boolean = false): void {
         var scene = this.getScene();
-
+        if(this.name == "outputTextureX"){
+            debugger;
+        }
+        
         if (!scene) {
             return;
         }
@@ -721,7 +724,8 @@ export class RenderTargetTexture extends Texture {
         this.onAfterUnbindObservable.notifyObservers(this);
 
         if (scene.activeCamera) {
-            if (this.activeCamera && this.activeCamera !== scene.activeCamera) {
+            // Do not avoid setting uniforms when multiple scenes are active as another camera may have overwrite these
+            if (scene.getEngine().scenes.length > 1 || (this.activeCamera && this.activeCamera !== scene.activeCamera)) {
                 scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true));
             }
             engine.setViewport(scene.activeCamera.viewport);