Static sprites flickering when camera 2d has smoothing enabled. How to solve?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gtkampos
:warning: Old Version Published before Godot 3 was released.

When using camera in 2d projects that has smoothing enabled, sprites flicker (jitter) just before the camera settles.
The position of sprites is probably a non-integer, or the position of the camera.
The problem persists with or without pixel snap.

How can I solve this problem? Lets say, snap everything in pixels unit? Maybe with a script controlling the camera?

Couldn’t find any answer about this fact.

Thanks!!!

Are you using fixed processing?

avencherus | 2017-04-26 15:16

Tried with both process and fixed process. Same result.
It appears that, when I stop my character (2d platform game/pixel art style), the camera continue moving to settle its position. When this happen, the flickering/jittering happens on the caracter and in some parts of the scenary too. Maybe because its moving in a float speed, and the engine try to adapt the pixels to the render.

gtkampos | 2017-04-26 19:17

Is your problem similar to this one? https://forum.godotengine.org/6197/how-to-stop-camera-lag?show=6197#q6197

Zylann | 2017-04-26 19:23

I have jittering on my 2d pixel art game.

Tkaewkunha | 2017-11-27 16:49

@Zylann No, not this time, although that is a sneaky one. My camera doesn’t move in my test scene. The jitter is mostly caused by the objects being ejected from collision resolution. The best result I could get was by using a capsule with enough thickness.

For other problems I offset the slide angles on slopes and modified gravity, etc. Reduces a lot of the problems, but doesn’t entirely eliminate it. I’m thinking the RigidBody is not the way to go for characters in platformers, or maybe I’m missing out on some fundamental tricks.

avencherus | 2017-11-27 17:58

:bust_in_silhouette: Reply From: Ioannes Bracciano

I solved my flickering problems by enabling Use Pixel Snap option in project settings ( (under Rendering/Quality, on Godot 3.2)

under godot 3.3 the option is under Rendering/2d “Use GPU Pixel Snap”

LemonSqueezy | 2021-05-18 15:20

:bust_in_silhouette: Reply From: vnmk8

enable Mipmaps Under Flags in the Import tab and and click reimport. It solved my background sprites flickering. It still flickers at the edge of the sprites but that might be related to the camera movement, other sprites like the player one got blurry, so there might be another solution, maybe for pixel art style ones.

also try leaving 1 or 2 transparent pixels around the sprite when exporting the image as png in an image editor

vnmk8 | 2020-09-21 21:03