Skip to content

Commit

Permalink
Replace requestAnimationFrame() -> setAnimationLoop()
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Nov 2, 2023
1 parent d3ab965 commit 26846ad
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
4 changes: 1 addition & 3 deletions examples/webgpu_clearcoat.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
let group;

init();
animate();

function init() {

Expand Down Expand Up @@ -187,6 +186,7 @@
renderer = new WebGPURenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setAnimationLoop( animate );
container.appendChild( renderer.domElement );

//
Expand Down Expand Up @@ -227,8 +227,6 @@

function animate() {

requestAnimationFrame( animate );

render();

stats.update();
Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu_instance_points.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
let insetHeight;

init();
animate();

function init() {

Expand All @@ -69,6 +68,7 @@
renderer = new WebGPURenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );

scene = new THREE.Scene();
Expand Down Expand Up @@ -161,8 +161,6 @@

function animate() {

requestAnimationFrame( animate );

stats.update();

// main scene
Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu_lines_fat.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
let insetHeight;

init();
animate();

function init() {

Expand All @@ -68,6 +67,7 @@
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setClearColor( 0x000000, 0.0 );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );

scene = new THREE.Scene();
Expand Down Expand Up @@ -173,8 +173,6 @@

function animate() {

requestAnimationFrame( animate );

stats.update();

// main scene
Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu_loader_gltf_sheen.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
let camera, scene, renderer, controls;

init();
animate();

function init() {

Expand Down Expand Up @@ -84,6 +83,7 @@
renderer = new WebGPURenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setAnimationLoop( animate );
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
container.appendChild( renderer.domElement );
Expand Down Expand Up @@ -126,8 +126,6 @@

function animate() {

requestAnimationFrame( animate );

controls.update(); // required if damping enabled

render();
Expand Down
3 changes: 1 addition & 2 deletions examples/webgpu_video_panorama.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
const distance = .5;

init();
animate();

function init() {

Expand Down Expand Up @@ -87,6 +86,7 @@
renderer = new WebGPURenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setAnimationLoop( animate );
container.appendChild( renderer.domElement );

document.addEventListener( 'pointerdown', onPointerDown );
Expand Down Expand Up @@ -139,7 +139,6 @@

function animate() {

requestAnimationFrame( animate );
update();

}
Expand Down

0 comments on commit 26846ad

Please sign in to comment.