|
@@ -3523,9 +3523,15 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
|
|
|
|
this._intermediateRendering = false;
|
|
|
|
|
|
- // Bind the frame (this is needed to be done in case a subcamera has an outputRenderTarget)
|
|
|
- // TODO this undoes the change that addresses this https://github.com/BabylonJS/Babylon.js/issues/6124
|
|
|
- this._bindFrameBuffer();
|
|
|
+ // Need to bind if sub-camera has an outputRenderTarget eg. for webXR
|
|
|
+ if(this.activeCamera && this.activeCamera.outputRenderTarget){
|
|
|
+ needRebind = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Restore framebuffer after rendering to targets
|
|
|
+ if (needRebind) {
|
|
|
+ this._bindFrameBuffer();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|