Skip to content

Commit

Permalink
WebVRManager: Added submitFrame()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 16, 2017
1 parent d81f53b commit 5e79a45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,6 @@ function WebGLRenderer( parameters ) {

// update camera matrices and frustum

camera.onBeforeRender( _this );

if ( camera.parent === null ) camera.updateMatrixWorld();

if ( vr.enabled ) {
Expand Down Expand Up @@ -1306,7 +1304,11 @@ function WebGLRenderer( parameters ) {

}

camera.onAfterRender( _this );
if ( vr.enabled ) {

vr.submitFrame();

}

// _gl.finish();

Expand Down
6 changes: 6 additions & 0 deletions src/renderers/webvr/WebVRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ function WebVRManager( renderer ) {

};

this.submitFrame = function () {

if ( device && device.isPresenting ) device.submitFrame();

};

}

export { WebVRManager };

0 comments on commit 5e79a45

Please sign in to comment.