Thanks!
> Have any of you ever gotten lost tweaking fade functions to get that perfect wave-like look?
You cannot use anything for the fade function, because you likely want the derivative (and potentially the second derivative) to be 0. See https://gist.github.com/KdotJPG/417d62708c76d53972f006cb906f... for making different ones. I personally never tried anything else than the hermite and the quintic.
I'm really lost, but alas have ~0 experience with 3D about 15 years into a career.
Ignoring variable frame rate: 1. Doesn't the frame rate depend on the display hardware?
2. Can you know the frame rate at runtime?
Variable frame rate: 3. What quantity do you use for frame rate for variable frame rates?
2. You can know the targeted frame rate, you can also infer it by averaging the delta times at runtime (not reliable but maybe more accurate on a slow machine?)
3. In my graph, I did pick random delta between 15 and 120 fps IIRC; the point was to simulate what could roughly happen with random lag spikes
a = lerp(a, B, 1.0 - exp(-delta * RATE2))
Write: a = lerp(a, B, -expm1(-delta * RATE2))
This is precisely the situation where you really want to use expm1:
https://www.johndcook.com/blog/cpp_expm1/And (as pointed in the above) if you're worried about the slowness of it, just Taylor expand it to x+x²/2.
Finally, unless division is too costly, do:
a = lerp(a, B, -expm1(delta / -T))
Where T is the “time constant” (which you can intuitively express in time units, like seconds):
https://en.wikipedia.org/wiki/Exponential_smoothing#Time_con...It's not the half-life (sorry) but it's still a lot more intuitive as a parameter.
> So there we have it, the perfect formula, frame rate agnostic ,
... worth noting what happens on a frame time spike.
I don't know if you tried before, but compressing noise is particularly hard, so 16 videos would have been quite too much of bandwidth. The total size of the shaders is something around 70kB (not minimized) for endless lossless videos, and since I had to write them anyway if I were doing records of them, it was really a no-brainer to embed them to be honest.