You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new useFrame API looks great! I really like the explicit FPS.
Currently, we have our own physics clock implementation which has a fixed timestep. One key component of it is interpolation. That is, if we're running at 24 FPS, but the game is rendering at a higher frame rate, the render frame interpolates between physics frames.
Is this something that the new API will support? I couldn't find anything explicit in the docs about it.
Proof of concept:
conststate=useRef({x: 0,prevX: 0,});useFrame(()=>{state.prevX=x;state.x+=0.01;},{fps: 24});useFrame(()=>{constalpha=// a number between 0 and 1 dictating how much we are between the most recent physics frame and the upcoming one. Where to get this number from?constrenderedX=state.prevX+(state.x-state.prevX)*alpha;renderSomething(renderedX);});
Just checking to see if this a supported use-case, or something that's being considered with the new scheduler.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The new
useFrameAPI looks great! I really like the explicit FPS.Currently, we have our own physics clock implementation which has a fixed timestep. One key component of it is interpolation. That is, if we're running at 24 FPS, but the game is rendering at a higher frame rate, the render frame interpolates between physics frames.
Is this something that the new API will support? I couldn't find anything explicit in the docs about it.
Proof of concept:
Just checking to see if this a supported use-case, or something that's being considered with the new scheduler.
Beta Was this translation helpful? Give feedback.
All reactions