How to get DPI scaling in material

Is there a material node that returns the DPI scaling for the current object being drawn? This can be useful for UMG material.

Normally there’s a curve you can configure.
Scale UI for Different Devices | Unreal Engine Documentation.

Right now in my material I’m scaling something by taking the render target size and scaling by what my UI’s DPI 1 scale resoltion would be. UI Material posted by anonymous | blueprintUE | PasteBin For Unreal Engine

It’d be way more reliable if it was able to use the DPI scaling in the material expression instead so it’d use the curve. It could also work correctly when I’m not rendering the UI to the screen but instead to a 3D widget.

Oh I think I found exactly what I’m looking for in the same node I was using to return the render target size.

I just need to select the ScreenPercentage property instead. :rofl:

Oh wait, never mind, I don’t think that’s UI DPI. That’s actually the 3D rendering resolution percentage.

1 Like