fireworks-js icon indicating copy to clipboard operation
fireworks-js copied to clipboard

Make parameters independent of rendering speed

Open CWBudde opened this issue 3 years ago • 0 comments

Several parameters (such as the decay time) are currently dependent on the rendering time. This means that the output is significantly different for a different frame rate. I.e. with 60 fps the rays decay earlier than with 30 fps (twice as fast). In fact it should take the time since the last rendering into account.

To do so, the additional 'timestamp' from the requestAnimationFrame call can be used. This must only be compared to the previous timestamp. The initial timestamp can be retrieved by using window.now

CWBudde avatar Jan 02 '22 16:01 CWBudde