3 ms·
I know it's harder, but can we please decouple state updates from rendering?
by nottorp 3y ago
I know it's harder, but can we please decouple state updates from rendering?
- nine_k 3y agoGPU could compute state separate from rendering, if such updates are simple and independent enough. (In many cases, they are not.)
- taneq 3y ago100%. This relatively small amount of extra work makes it SO much easier to debug both rendering and state update code.
- matsemann 3y agoEven better would probably be to run the state update X amount of times per second, not depending on framerate at all. Otherwise you mess with physics. And then render based on delta and interpolate movements.
- nottorp 3y agoI thought thats what i meant by decoupling :) Although using a time delta makes OT easier than having to force X times Per second
- matsemann 3y agoYeah my comment was probably supposed to be to a different sibling. Using a time delta would give different results when doing non-linear stuff. Like applying forces. It's different to apply "force * dt" vs doing "force * 0.5dt" twice. Also if you use a big dt you could end up going through walls or similar. So therefore the physics engine should run at defined ticks in most instances, or it will behave differently based on framerate. https://gafferongames.com/post/fix_your_timestep/ https://gafferongames.com/post/fix_your_timestep/
- iamflimflam1 3y agoIn all the, admittedly amateur, games I’ve made I’ve been very religious about this. It never even occurred to me that not splitting this was an option. And I can’t think of any reason why you’d combine them.