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

Subpixel Jitter Fix (Partial) #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanHackerCG
Copy link

This is the subpixel jitter improvement I did for Tom. All of my changes are marked with a comment containing "Cloaked Games" so you can search and see what I did. I will summarize here:

The main change is I added a spd_min property to the camera, which is added to the speed of the camera each frame, basically ensuring it never moves smaller than the spd_min. When this value is set to 1, the camera will never move a subpixel amount. This removes any visible subpixel jitter at the camera approaches its target, at the cost of the camera moving a bit faster overall and stopping more suddenly.

However, my solution is probably not production ready. It is fully incompatible with animation curves due to them using displacement, not speed. To make this fix work, I bypassed several of the animation curves, and in fact combined the offset with the regular movement.* If you want to use my improvement, I recommend looking over my code and integrating it more thoroughly before sending to anyone else to use. I am happy to answer clarifying questions via Discord.

*I might recommend combining all the movement into a single step generally, and using the various animations only to calculate the target position. As it is, the several competing movement steps sometimes results in chaotic or jarring motion to my eyes. That is an overarching change out of the scope of this pull request, and dependent on Stann's design goals.

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.

None yet

1 participant