Skip to content

Commit 722487e

Browse files
Mugen87cabanier
authored andcommitted
XRManager: Fix tone mapping and output color space.
1 parent 0d0a80a commit 722487e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/renderers/common/Renderer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,11 @@ class Renderer {
13941394

13951395
}
13961396

1397+
const currentXREnabled = this.xr.enabled;
1398+
1399+
this.xr.enabled = false;
13971400
this._renderScene( quad, quad.camera, false );
1401+
this.xr.enabled = currentXREnabled;
13981402

13991403
}
14001404

@@ -1992,7 +1996,7 @@ class Renderer {
19921996
*/
19931997
get currentToneMapping() {
19941998

1995-
return this._renderTarget !== null ? NoToneMapping : this.toneMapping;
1999+
return ( this._renderTarget !== null && this._renderTarget.isXRRenderTarget !== true ) ? NoToneMapping : this.toneMapping;
19962000

19972001
}
19982002

@@ -2004,7 +2008,7 @@ class Renderer {
20042008
*/
20052009
get currentColorSpace() {
20062010

2007-
return this._renderTarget !== null ? LinearSRGBColorSpace : this.outputColorSpace;
2011+
return ( this._renderTarget !== null && this._renderTarget.isXRRenderTarget !== true ) ? LinearSRGBColorSpace : this.outputColorSpace;
20082012

20092013
}
20102014

src/renderers/common/XRManager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,7 @@ class XRManager extends EventDispatcher {
632632
type: UnsignedByteType,
633633
colorSpace: renderer.outputColorSpace,
634634
depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
635-
stencilBuffer: attributes.stencil,
636-
samples: attributes.antialias ? 4 : 0
635+
stencilBuffer: attributes.stencil
637636
} );
638637

639638
this._xrRenderTarget.hasExternalTextures = true;

0 commit comments

Comments
 (0)