Skip to content

Subpixel Jitter Fix (Partial)#77

Open
CloakedGames wants to merge 1 commit intostann-co:masterfrom
CloakedGames:cloaked_subpixel_jitter
Open

Subpixel Jitter Fix (Partial)#77
CloakedGames wants to merge 1 commit intostann-co:masterfrom
CloakedGames:cloaked_subpixel_jitter

Conversation

@CloakedGames
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.

1 participant