A unity implementation of Exponential Smoothing and the One Euro Filter in CSharp.
- Add the script to a Game Object.
- Set the public variables.
- For Exponential Smoothing, set Alpha to 1 and decrease until jitter is reasonable. Alpha closer to 0 increases lag.
- For One Euro Filter, set Jitter Reduction to 1 and Lag Reduction to 0. Increase the values to reduce jitter and lag.
- When implementing, call OneEuroFilter and use filteredPosition instead of Input.GetTouch(0).position.
I will work on making a struct so that it takes all touches from Input.touches and has filteredPosition for each touch. Any suggestions can be emailed to me at slek120@gmail.com