Skip to content

Commit 75f08d9

Browse files
Enable post-processing in VR (#20)
* Update WebXRManager.js * Update WebGLRenderer.js * Update WebGLRenderer.js deleted useless blank lines * Update WebXRManager.js - Deleted useless code and blank lines - refectored _getRenderTarget to getRenderTarget * Update WebGLRenderer.js Reflect the refactoring of getRenderTarget function
1 parent b10b9ad commit 75f08d9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/renderers/WebGLRenderer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,13 @@ class WebGLRenderer {
23352335
const _scratchFrameBuffer = _gl.createFramebuffer();
23362336
this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {
23372337

2338+
// Render to base layer instead of canvas in WebXR
2339+
if ( renderTarget === null && this.xr.isPresenting ) {
2340+
2341+
renderTarget = this.xr.getRenderTarget();
2342+
2343+
}
2344+
23382345
_currentRenderTarget = renderTarget;
23392346
_currentActiveCubeFace = activeCubeFace;
23402347
_currentActiveMipmapLevel = activeMipmapLevel;

src/renderers/webxr/WebXRManager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ class WebXRManager extends EventDispatcher {
248248

249249
};
250250

251+
this.getRenderTarget = function () {
252+
253+
return newRenderTarget;
254+
255+
};
256+
251257
this.getFrame = function () {
252258

253259
return xrFrame;

0 commit comments

Comments
 (0)