Limiting framerate in Three.js to increase performance, requestAnimationFrame?

后端 未结 5 2099
终归单人心
终归单人心 2020-12-24 03:26

I was thinking that for some projects I do 60fps is not totally needed. I figured I could have more objects and things that ran at 30fps if I could get it to run smoothly at

5条回答
  •  情歌与酒
    2020-12-24 03:44

    What about something like this:

    function animate() {
    
        setTimeout( function() {
    
            requestAnimationFrame( animate );
    
        }, 1000 / 30 );
    
        renderer.render();
    
    }
    

提交回复
热议问题