GetUserInterfaceUV Pixel Size for Draw Material on HUD

I have had trouble using Draw Material in a HUD blueprint. It seems that the UV’s are not what I’m expecting. I’ve boiled this down to the simplest reproduction I can. Note that my project is a top-down ortho camera and everything unlit.

Here is my material.

Note that domain is set to User Interface. I am using the pixel size to determine a horizontal aspect ratio, then using that to scale out my UV in order to preserve aspect ratio. I’m using Frac for debug purposes here and outputting directly into color so we can easily interpret the UV calculation (rather than passing them into the UV inputs of a shape generation function as I would do in my real use case). The output is exactly what I would expect… because the preview width is 4 times the height, I can see that my transformed uv’s vertically are 0-1 and horizontally 0-4.

HUD Blueprint:
image

I’m rendering the material on a quad on the HUD via Draw Material at the exact same pixel size as the preview. Yet here is the crazy result:

image

How is drawing this on the HUD giving me different results? If I were to change the material to directly draw the Normalized UV as the color, I see a continuous 0-1 gradient in both directions (though stretched) so it seems that Pixel Size is where I’m encoutering weirdness.

OK, let’s visualize Pixel Size. Dividing it by the known pixel size of the preview and the rendered quad should give us [1,1], let’s apply that to a color to make sure we are getting a constant value we expect.


When running it:
image

Oh, wow, Pixel Size R & G is practically non-existent. Why isn’t it giving me the size of the quad I’m drawing on the HUD? The engine obviously knows the proper bounds of the quad, as it was able to provide meaningful normalized UVs.

UE 5.2.1

By the way, I have been able to use the same material in a widget and attach it to viewport, and it displays perfectly fine. This would often be fine, but I’m not satisfied. I would like to know what is wrong and have the possibility of using Draw Material node.