pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

max FPS control in useFrame() #3122

Open AirSurfer09 opened 11 months ago

AirSurfer09 commented 11 months ago

Sample code : useFrame(100), runs the frame-loop max 100 fps depending on the client pc performance. lodash .throttle might be useful : https://www.geeksforgeeks.org/lodash--throttle-method/

clementroche commented 11 months ago

something like:

useFrame(()=>{
  // your callback
  },
  {
    throttle: 100,
    priority: 0,
  })
CodyJasonBennett commented 7 months ago

cc @krispya this will need to be a documented pattern.