Skip to content

Commit

Permalink
Add framerate limit option to make perf delta more pronounced on less…
Browse files Browse the repository at this point in the history
… capable devices
  • Loading branch information
felixtrz committed Nov 3, 2023
1 parent c784ae5 commit 4f5f219
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/webxr_vr_multiview.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> experimental support for multiviewStereo<br/>
(Oculus Browser 16.1+)
<button type="button" id="multiview-button"></button>
<input type="checkbox" id="framerate-limit" name="framerate-limit">
<label for="framerate-limit"> Framerate Limit: 72fps</label><br>

</div>

Expand Down Expand Up @@ -104,7 +106,11 @@
document.body.appendChild( renderer.domElement );
renderer.xr.addEventListener( 'sessionstart', () => {

renderer.xr.getSession().updateTargetFrameRate( 72 );
if ( document.getElementById( 'framerate-limit' ).checked ) {

renderer.xr.getSession().updateTargetFrameRate( 72 );

}

} );

Expand Down

0 comments on commit 4f5f219

Please sign in to comment.