# Subpixel movement in UMG?

**URL:** <https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 27, 2022, 2:21pm UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511 "2022-09-27T14:21:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [September 27, 2022, 2:21pm UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/1 "2022-09-27T14:21:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [September 27, 2022, 7:45pm UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/2 "2022-09-27T19:45:14Z")

</div>

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:

 ![bild](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/2/b1238499dbaf150068ad9d836a9d8bc5f810967d.png)

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:

 ![bild](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/2/f52cddcc9a9780823baf05b7658e4e36e99d3de5.png)

---

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [September 28, 2022, 6:44am UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/3 "2022-09-28T06:44:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 28, 2022, 7:20am UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/4 "2022-09-28T07:20:53Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/2/0e2d9d6a0ef69c5f8fcb4137ebe8786893eccec5.jpeg)

In a 1:1 mapping scenario, there’s no such thing as 0.26 pixel, they’re integers:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/e/c6e847dd89174bdfcb32fa80393d34db98a466f2.png)

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:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/9/b7999c3b4b14cdd1a30bfd3e972dc1f0e0dd366f.png)

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.

* * *

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/c/01cd4a6fd13800e73cca35f41768b3444d039417.jpeg)

Mario does not have much control over his eye movement in the above scenario.

---

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [September 29, 2022, 7:27am UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/5 "2022-09-29T07:27:26Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 29, 2022, 8:33am UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/6 "2022-09-29T08:33:36Z")

</div>

> [@OrfWare](#):
>
> 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:

> [@UMG Movement Jitter](https://forums.unrealengine.com/t/umg-movement-jitter/308403):
>
> Hey there, I recently added some UMG’s that pop up to show damage done to an enemy. I followed this tutorial to do it… [https://forums.unrealengine.com/showthread.php?50130-UMG-Tutorial-Placing-Widgets-Over-Actors-In-Screenspace](https://forums.unrealengine.com/showthread.php?50130-UMG-Tutorial-Placing-Widgets-Over-Actors-In-Screenspace) My issue is that when the UMG is moving around the screen as the player continues on running around there is a noticable jump as the umg goes from one pixel to the next as if it isn’t properly blending the image when it is “bewteen” two pixels. I think i’ve seen someth…

Apparently you can combat it, to an extent, with render translation. It’s mostly _hacking_ around problem, though.

---

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [September 29, 2022, 8:43am UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/7 "2022-09-29T08:43:35Z")

</div>

> it would be nice if we got to choose

Exactly.

---

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [February 22, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/subpixel-movement-in-umg/657511/8 "2023-02-22T15:43:26Z")

</div>

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… 😡 🙄 ☹
