Alpha with delta time

I have an alpha number of 0.8 and if the framerate is higher it dampens faster. What is the best way of using delta-time against an alpha dampener so it doesn’t speed up?

You multiply alpha by the delta time. Delta time is passed as an argument to the function inside of render stepped and stepped:

--renderstepped and heartbeat: dt
--stepped: step number, dt

this wouldn’t work. If the framerate was 120 that means the delta time would be 0.5.

0.8 * 0.5 = 0.4 (really low and not accurate)

showcase of this:
in three steps, 10 * 0.8.
10, 8, 6.4
in three steps, 10 * 0.4
10, 4, 1.4

at least read the post before saying anything

Usually, I do


Where FACTOR is around 10^-4 (0.0000001)

The delta time is one divided by the framerate. In this case, the framerate is 120. It rounds to 0.008.

I’ve done this before, it works for me.

you can have a variable which is (delta * 60 (or whatever framerate)) to show a clear division of framerate. In THIS case, 120 fps would be 0.5. Should’ve clarified, mb

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.