Wieku / danser-go

Dancing visualizer of osu! standard maps and custom osu! client written in Go. Also a generator for osu! videos.
Other
764 stars 104 forks source link

Added smooth cursor #338

Open RugiSerl opened 1 year ago

RugiSerl commented 1 year ago

Added smooth cursor implementation, done by doing linear interpolation with multiple cursors.

Also added function to pause game rendering with space

7ez commented 1 year ago

might want to remove that binary

RugiSerl commented 1 year ago

Oh yes, I added it by mistake 🤦

RugiSerl commented 1 year ago

Ok I'll try to make this understandable :).

Explanation of "smooth cursor": When people want smooth video of gameplay, they often record their game at high framerate and then resample the video down to 60 fps. Here what it looks like: image smooth cursor aims to get the same result for the cursor without resampling the video, by simply rendering a bunch of time the cursor texture between the last and the current cursor position, like this:

image 5 cursors image 50 cursors

and it also changes the opacity of the cursor depending on its speed : image

In the end this method is much faster than resampling the video, and can be performed in real time in Wach mode. I am hoping this explanation is a bit more helpful :)

PercyDan54 commented 1 year ago

What is the difference of this compared to ForceLongTrail + LongTrailDensity ?

RugiSerl commented 1 year ago

They are few differences : -the long trail uses the texture "cursortrail.png" instead of "cursor.png" -the long trail works by letting trail particles stay on screen for a certain amount of time while smooth cursor will work by drawing a "line of cursors" between the last cursor position and the current one. I tried to represent graphically how it works: image (1)

PercyDan54 commented 1 year ago

They are few differences : -the long trail uses the texture "cursortrail.png" instead of "cursor.png" -the long trail works by letting trail particles stay on screen for a certain amount of time while smooth cursor will work by drawing a "line of cursors" between the last cursor position and the current one. I tried to represent graphically how it works: image (1)

  1. ForceLongTrail already force using cursor.png to draw trail if cursortrail is absent.

  2. I don't think using line density instead of point distance (since you are just linear interpolating between frames) to show movement speed is a good change.

Will leave that to Wieku