Download

Using non power of 2 image sizes for UMG widgets on mobile (iOS)

Is it possible to use non power of 2 sized images with UMG widgets on mobile devices (specifically iOS)? I have read conflicting things, but mostly what I have read is that for UMG widgets textures/images don’t have to be power of 2 sized. But when I tried to use irregular sized images for my widgets I get filler textures that seem to indicate they need to be power of 2 sized when deploying to my iPhone 6 (as shown here):

I’m hoping there is some setting that can fix this, but if they must be power of 2 sized, how can I set texture coordinates when creating a brush from the texture in a blueprint? If I have an image padded to a power of 2 for height/width, I only want the original image to show up in my UMG widget, not the padding. But there doesn’t seem to be any way to do this with the MakeBrushFromTexture node.

Digging a bit deeper I see that I can create materials from my padded textures and set the UV coordinates to crop the padding, but this seems like a lot of extra work for what should be a simple thing. And elsewhere I see recommendations to not use materials for UMG widgets.

Update:
It seems I can use TexturePacker to create a sprite sheet that Unreal Engine can interpret as a Paper 2D sprite sheet, and that I can set the image for my button widgets to point to the sprites in the sprite sheet. This is a reasonable workflow for me.

I also had such problems. I created a list of optimal sizes for a phone game.
For Background (2220x1249)
For button (262x270) (600x426)
For inscriptions or long buttons (1234x416)
I experimented for a long time and these sizes always work on all devices.

This is badly documented, however for UI you can make non-power of two textures work on iOS by setting texture’s compression to UserInterface2D

Seems like you can use “Default” texture compression instead of inefficient UserInterface2D, however you need to disable PVRTC compression in iOS settings and enable ASTC compression there too.

Unreal is not allowing to even import a non-power of 2 image, how to bypass this?