texture/sprite jitter when moving transform (with screenshot)

3213791--246040--1.gif

I’ve spent good 20 hours trying to solve this but it really beats me. As seen in the above picture, texture/sprite jitters when moving transform. I’m using pixel art/sprite to make it easier to understand but it does happen regardless
of whether its sprite or mesh, point or bilinear filter, perspective or orth camera, or any other stuff I can think of(anisotropic texture, power of 2 size, anti aliasing, wrap mode, texture format/compression)

The DOTween component is just tweening x position.
I believe it has something to do with float precision as it happens a lot when x is above 1000+ but it does also happen even when x is below 10 if the transform is rotated or have some parent transform(which also is related to float precision, I believe).
Does anyone know how to fix the problem?
The jitter stops when not moving position or rotation.

You must be using a Sprite Renderer or 2D Material that has “pixel perfect” or “pixel snap” turned on. Each pixel on your image will snap to the nearest pixel in your game view, so if you move the image slowly, you can see each pixel in your source image individually jump to a different pixel in the game view.

To fix this, you will have to either disable the pixel perfect option, or make sure when you move your sprite, it moves by a value that is a multiple of a pixel’s size.

3214230--246102--1.gif

Thanks for the response. I did use Sprite Renderer and the pixel snap option on default Sprite shader for the previous screenshot but it happens on any mesh and default shaders and any texture( I’m using pixel art for screenshots because it’s easier to see the problem)

Hmmm… do you have the filter type set to “point” for that sprite asset?

Yes, I’m using point filter for the above screenshots. Using bilinear filter 99% eliminates the jitter but I wanted to use point filter for sharp images.
For now, I’m using paint tool(or photoshop) to make big textures out of small pixel arts(like 10x the original size) and applying bilinear filter so that the blurry edges are less visible. Though, I’d still like to be able to use point filter if I can, for it still looks better and much memory efficient.

I think the point filter works a bit like the pixel snap I described above… if the pixel on the image doesn’t exactly line up with a pixel on the Game View, it will render to one or both of those pixels (Bilinear filter will blue it between those 2 pixels based on how close they are). Smooth movements will be difficult unless you move the object by multiples of the distance of 1 pixel per frame.

hi, I also have the same problem, did you find the solution?:slight_smile:

Did you find the solution, if yes then please share it. I need it badly

I know this is very late, but to anyone having this problem, make sure your code for moving the object and your code for rotating it are both called in either FixedUpdate or Update. I had my rotation code in Update and my movement in FixedUpdate, and when I moved the rotation to FixedUpdate the jittering went away.

I’m still having this problem. I’m using dotween to move my UI button slowly and it jitters/stretches the image.