Skip to content

Commit

Permalink
reduce extra renderpass with depth sensing
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier committed Feb 14, 2024
1 parent b0e6fad commit 64dfe94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/renderers/WebGLRenderer.js
Expand Up @@ -1178,6 +1178,8 @@ class WebGLRenderer {

renderListStack.push( currentRenderList );

if ( _this.xr.getDepthSensingMesh() ) projectObject( _this.xr.getDepthSensingMesh(), camera, -Infinity, _this.sortObjects );

Check failure on line 1181 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

Unary operator '-' must be followed by whitespace

projectObject( scene, camera, 0, _this.sortObjects );

currentRenderList.finish();
Expand Down
6 changes: 3 additions & 3 deletions src/renderers/webxr/WebXRDepthSensing.js
Expand Up @@ -65,7 +65,7 @@ class WebXRDepthSensing {

}

render( renderer, cameraXR ) {
getMesh( cameraXR ) {

if ( this.texture !== null ) {

Expand All @@ -87,10 +87,10 @@ class WebXRDepthSensing {

}

renderer.render( this.mesh, cameraXR );

}

return this.mesh;

}

reset() {
Expand Down
8 changes: 6 additions & 2 deletions src/renderers/webxr/WebXRManager.js
Expand Up @@ -666,6 +666,12 @@ class WebXRManager extends EventDispatcher {

};

this.getDepthSensingMesh = function () {

Check failure on line 669 in src/renderers/webxr/WebXRManager.js

View workflow job for this annotation

GitHub Actions / Lint testing

Multiple spaces found before '='

return depthSensing.getMesh( cameraXR );

};

// Animation Loop

let onAnimationFrameCallback = null;
Expand Down Expand Up @@ -791,8 +797,6 @@ class WebXRManager extends EventDispatcher {

}

depthSensing.render( renderer, cameraXR );

if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );

if ( frame.detectedPlanes ) {
Expand Down

0 comments on commit 64dfe94

Please sign in to comment.