+5 votes

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!!!

in Engine by (191 points)

Are you using fixed processing?

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.

I have jittering on my 2d pixel art game.

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

2 Answers

+2 votes

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

by (18 points)

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

+1 vote

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.

by (438 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.