stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.61k stars 953 forks source link

Add ExpDecay function for framerate independent damping #2301

Closed tebjan closed 1 month ago

tebjan commented 5 months ago

Is your feature request related to a problem? Please describe. See, Lerp smoothing is broken, click the video below: Enhanced Exponential Decay Function Explanation

Describe the solution you'd like image

instead of: a = lerp(a, b, damping * dt)

Implementations for both, C# and SDSL.

Here are some questions that can aid in the description of the feature request:

Kryptos-FR commented 5 months ago

The only issue is that exp() is more expensive computationally.

tebjan commented 5 months ago

The more important issue ist that Lerp smoothing doesn't work correctly. Watch the first half of the video. Especially if you want to deliver a consistent user experience on all machines. It might not affect SFX too badly, but if gameplay relies on it, no option has better performance.