Przeglądaj źródła

Merge pull request #852 from BabylonJS/RaananW-RenderTargetTexture

Update babylon.renderTargetTexture.ts
David Catuhe 9 lat temu
rodzic
commit
95ef6649f2

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

@@ -126,6 +126,10 @@
 
         public render(useCameraPostProcess?: boolean, dumpForDebug?: boolean) {
             var scene = this.getScene();
+            
+            if (this.activeCamera !== scene.activeCamera) {
+        		scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true));
+        	}
 
             if (this._waitingRenderList) {
                 this.renderList = [];
@@ -179,6 +183,10 @@
             if (this.onAfterUnbind) {
                 this.onAfterUnbind();
             }
+            
+            if (this.activeCamera !== scene.activeCamera) {
+        		scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true));
+        	}
 
             scene.resetCachedMaterial();
         }
@@ -276,4 +284,4 @@
             return serializationObject;
         }
     }
-} 
+}