Skip to content

Commit

Permalink
Enable post-processing in VR (#20)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
enzofrancescaHM authored Jan 31, 2025
1 parent b10b9ad commit 75f08d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,13 @@ class WebGLRenderer {
const _scratchFrameBuffer = _gl.createFramebuffer();
this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {

// Render to base layer instead of canvas in WebXR
if ( renderTarget === null && this.xr.isPresenting ) {

renderTarget = this.xr.getRenderTarget();

}

_currentRenderTarget = renderTarget;
_currentActiveCubeFace = activeCubeFace;
_currentActiveMipmapLevel = activeMipmapLevel;
Expand Down
6 changes: 6 additions & 0 deletions src/renderers/webxr/WebXRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ class WebXRManager extends EventDispatcher {

};

this.getRenderTarget = function () {

return newRenderTarget;

};

this.getFrame = function () {

return xrFrame;
Expand Down

0 comments on commit 75f08d9

Please sign in to comment.