Anyone know the fix for this problem? The problem is that my button edges seems to be shaking because of animation. I think this is anti-aliasing problem, but I’m not sure though.
Pivot is correctly centered with pivot_offset_ratio = Vector2(0.5, 0.5)
I think you could do it step by step by set values you yourself have decided in process to make it smoother, and reverse animation based on a frame counter. It is a bit clunky to implement. When you do it in a tween the tween will calculate the amount. Maybe some of those amounts cause the jerkiness.
If you need it i could post a code example later when on the laptop
I managed to make it barely noticeable by changing the renderer to Forward+ and bumping the anti-aliasing quality to max:
Use TSAA
Use Debanding
MSAA 2D maxed
SMAA Detection (lowest)
The shaking and edge problem are barely visible. Unfortunately, changing the renderer is not an option for me.
However, I think the anti-aliasing solution is just a band-aid.
I’m really surprise this wasn’t fixed or discovered after all these years because it’s literally the most common way to animate a UI and the set-up needed for it is very easy to reproduce.
There’s a slight shaking, though I’m not sure many people will notice it. But if you’re a stickler for perfection (like I sometimes am), you can try a vector image and DPITexture.
Although there’s no absolute guarantee that it will help.
I think it’s important to report the issue. Solving issues will only make Godot better and that will benefit everyone.
And yep, it is a waste of time because I’m done with my gameplay and I can’t produce the UI style that matches my game art with Godot UI system. I guess I’m done with this problem and will just resort on the old UI sprite art .
I’m really surprised by how powerful Godot UI system is. I think it’s great, but it has its own problems (I wish I can contribute but I’m not as smart as contributors!).
I’m using built-in Control nodes though. I will have to create vector arts (which I have no idea how to do) if I want to use it for a simple button background and use shaders to round its corners (which StyleBoxFlat have by default). But still, I appreciate the help!
It’s less of trying to achieve perfectness, I just want the UI to reflect the cute, soft and bouncy style my game art has, but the shakiness is killing me
This is not an “issue”. If you’re animating the scale of a non-square hard rectangle, the rasterization of the edge must fall on a pixel. Since proportion is elongated, the moment when the snapping to the next pixel happens will differ for horizontal and vertical edges, making the apparent proportion slightly differ for some scale values. It may happen even for squares depending on the sub-pixel positioning.
If you want it smooth, use a slightly blurred bitmap with padded edges, so there’s no hard edges that need to be rasterized to an exact pixel.