Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added smooth cursor #338

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Added smooth cursor #338

wants to merge 2 commits into from

Conversation

RugiSerl
Copy link

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

Also added function to pause game rendering with space

…n with multiple cursors.

Also added function to pause game rendering with space
@7ez
Copy link

7ez commented Jul 22, 2023

might want to remove that binary

@RugiSerl
Copy link
Author

Oh yes, I added it by mistake 🤦

@RugiSerl
Copy link
Author

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
Copy link
Contributor

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

@RugiSerl
Copy link
Author

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants