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

Camera smoothing causes sprites to flicker #2667

Closed
seadra opened this issue Oct 24, 2015 · 12 comments
Closed

Camera smoothing causes sprites to flicker #2667

seadra opened this issue Oct 24, 2015 · 12 comments

Comments

@seadra
Copy link

seadra commented Oct 24, 2015

When using 2d pixel snap with a camera that has smoothing enabled, sprites flicker (move, say, left-right ~1 pix several times) just before the camera settles.

The position of spires is probably a non-integer.

Edit: Problem persists without pixel snap.

@seadra
Copy link
Author

seadra commented Oct 24, 2015

I was comparing the project settings against the platformer demo and I noticed something strange: my projects doesn't even have rasterizer/use_pixel_snap option!

The project was created with the git tip.

@reduz
Copy link
Member

reduz commented Oct 24, 2015

i guess make some test scene

On Sat, Oct 24, 2015 at 12:59 PM, seadra [email protected] wrote:

I was comparing the project settings against the platformer demo and I
noticed something strange: my projects doesn't even have
rasterizer/use_pixel_snap option!

The project was created with the git tip.


Reply to this email directly or view it on GitHub
#2667 (comment).

@seadra
Copy link
Author

seadra commented Oct 27, 2015

Here is a test project that shows the flickering problem.

I disabled mipmaps and filter because things were blurry and I was getting strange artifacts like this:
screenshot (see the left side of the characters hand, there is a strange line)

@seadra
Copy link
Author

seadra commented Oct 27, 2015

The flickering of the sprite is present with or without pixel snap it seems.
The problem seems to be Camera2D smoothing.

@vnen vnen added this to the Later milestone Oct 29, 2015
@seadra seadra changed the title 2d pixel snap + smoothing camera = flickering sprites Camera smoothing causes sprites to flicker Nov 20, 2015
@akien-mga akien-mga removed this from the Later milestone Jan 5, 2016
@Alex-doc
Copy link
Contributor

I'm having a similar problem with ParallaxBackground, setting the camera2D smoothing on and to a very low value makes the parallax look "jittery". Seems to me that is due to the camera smoothing.
Might need some more interpolation here?

@reduz
Copy link
Member

reduz commented Jun 16, 2016

can you make a small demo project?

On Thu, Jun 16, 2016 at 10:36 AM, Alex [email protected] wrote:

I'm having a similar problem with ParallaxBackground, setting the camera2D
smoothing on and to a very low value makes the parallax look "jittery".
Seems to me that is due to the camera smoothing.
Might need some more interpolation here

smoothed_camera_pos = ((camera_pos-smoothed_camera_pos)*c)+smoothed_camera_pos;
?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2667 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AF-Z26NJxOiP_RlB3ze_afHgVJydceSxks5qMVFUgaJpZM4GVCGS
.

@Alex-doc
Copy link
Contributor

Alex-doc commented Jun 16, 2016

On my game seems to happen even without smoothing camera when I set the drag margin off.
I went very close to the issue with the demo here the glitch seems to show up better on less performant hardware.

To be clear, I'm not referring to the repeating of the parallax.
I'm referring to the actual jittery motion when you slightly and suddenly move the camera.
To better give the idea, it kinda looks like some sort of floating point imprecision with the position of the parallax or the camera. In my specific case, seems to happen when camera slightly/slowly moves on the "edge" of the drag margin.

@ghost
Copy link

ghost commented May 3, 2017

Folks any update on this?

I've tried drag margins off, disabling smoothness, updating the camera in fixed_update right below move, using the align() suggestion here as well. Nothing fixed the jitter

There is one solution though

You enable the filter under the Image Loader project settings.

However... some of my images I don't want the filter to be enabled on because I need the sharpness for that particular sprite. Is there a possible temporary work around for this?

@bojidar-bg
Copy link
Contributor

@Dillybob92 You should be able to update the filter on per-sprite basis by overriding its flags (AFAIK).

@ghost
Copy link

ghost commented May 3, 2017

@bojidar-bg yeah, looks like that will do for now. It's just some sprites for the world I don't want filtered as it ruins the sharpness of the image. I just don't know if this is what all game engines do, or just a godot thing. But filtering definitely fixes it. I thought it was a camera issue at first. reduz gave update here as well

@Calinou
Copy link
Member

Calinou commented Dec 24, 2019

Can anyone still reproduce this issue on 3.2beta4? If so, does setting the Camera2D update mode to Process improve the situation?

@Calinou
Copy link
Member

Calinou commented Jun 7, 2020

Duplicate of #35606, which has more information about the issue at hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants