mdegans / weave

Branching story writing tool with generative AI
Other
1 stars 0 forks source link

Force directed layout slower on 60hz displays #16

Open mdegans opened 2 months ago

mdegans commented 2 months ago

This is caused because the time step is currently a constant and every frame is a simulation tick. Fixing this will require keeping track of the actual frame rate, or perhaps the average over several frames. Then we use that as a time step. The simulation should then be consistent regardless of screen.

We could also somehow get the display refresh rate and use that, but it wouldn't be guaranteed to match the actual frame rate so there might be jank, which is bad. If the application can't render at the native frame rate, if it drops frames, this should not affect the simulation.