I’m trying to move around a 2d image in my widget very slowly, but it seems to “snap on pixels” even if I’m feeding it fractional coordinates - for instance a movement of say 10 pixel in 10 seconds in an animation. Is there a way to avoid that?
Absolutely, it could be due to the way you have setup the key interpolation. Select the key frames, right-click and change the interpolation to linear or constant:
If the snapping is an issue for you when moving elements / controls. You can change these values in the top right corner of the UMG Widget Editor:
Thanks @EliasWick but that’s not the problem. I’ll try to describe it better. I have set up an animation that moves an UMG image from x=0 to x=100 in 5 seconds. even if I print out the X values in blueprint and see, say, x=0 → x=0.05 → x=0.086… the image moves in one-pixel steps. I can see 100 pixel-sized steps, and this is the thing I’d like to avoid.
Er… 101 steps, sorry.
I’m trying to move around a 2d image in my widget very slowly, but it seems to “snap on pixels” even if I’m feeding it fractional coordinates
- below are 4 pixels; imagine you have a 1px sized image in bottom left. How would you move it from 0,1 to 1,0 coordinate in 3 steps? What coords would you use in step 2? You can only use integers to map a pixel:
In a 1:1 mapping scenario, there’s no such thing as 0.26 pixel, they’re integers:
If you move an image by .26 pixel, it won’t even move. The floats are around so you can accumulate values over time, and eventually shift the pixel to a new coordinate.
Try to move your mouse cursor very slowly, try stopping it between the pixels. You cannot.
I can see 100 pixel-sized steps, and this is the thing I’d like to avoid.
It would look pretty nice on a 8k screen, the steps would be small enough for us not to notice the jarring jerks - but we’re not there yet.
You could try different blurring option for the image that is moving:
The movement may look better, but the sharpness will (almost always) suffer. Worth trying.
Aliasing, pixel shifting, motion blurring, bleed and bloom, scaling is a whole paradigm I am not even going to pretend I understand well enough. If someone more knowledgeable comes along and contradicts the above, they’re probably right.
Mario does not have much control over his eye movement in the above scenario.
Well, this is clear, but this something I expect from Win32GDI, not Unreal’s UMG… I expected to be able to move half pixel in any direction and see the texture been interpolated on screen pixels - halftones and antialias etc.
In the end I achieved the needed effect not in UMG but in the 3D world, putting the texture on a mesh.
I ask: is this “pixel-perfect-ness” a by design behaviour in UMG?
It’s probably by-design but undesired in certain circumstances - it would be nice if we got to choose. In case you haven’t run into this thread:
Apparently you can combat it, to an extent, with render translation. It’s mostly hacking around problem, though.
it would be nice if we got to choose
Exactly.
I’m trying something with render translation, but to my knowledge this way too every movement snaps to pixels… this really makes me mad… I can rotate the thing half a degree but I can’t move it a fraction of a pixel…