Padded textures are displayed incorrectly and export sprites wrong

If you take a rectangle texture that is not in a power of two and enable padding in texture settings and then make a sprite with it, the image will be distorted. If you then export sprites out of it using automatic detection, it will export them wrong.

Example texture:

Texture when padded:

Sprite using the texture (if you look closely you can see it’s distorted by scaling down vertically a bit):

Preview of automated sprite export (looks correct):

Actual exported sprites:

Hey grisevg,

I do believe the Extract Sprites option is meant for default power of two texture sizes, as you can see, it needs to find the center of each sprite. It cannot do this even if the texture is padded to the power of two as the canvas of the texture is now a square, but it did not keep the sprites in their relative locations.

I found some helpful information on this topic by the paper 2D developer, and he has a couple of suggestions when working with non power of two textures.

[Paper 2D] Learning the Ropes

He explains how to work around using the extract sprites option when dealing with padded and non power of two textures. Let me know if you have questions.

Thank you,

Hey Andrew,

I do believe it’s a bug related to the fact the Sprites and “Extract Sprites” feature use wrong dimensions of a texture if it’s padded.
“Extract Sprites” feature works perfectly fine if you don’t pad textures, even if they are not in a power of two.
If there’s a technical limitation to extracting sprites out of padded textures, the editor should not let you do it.

I’m perfectly fine with using external tools to pad textures myself, just thought I should report the bug.

Hey grisevg,

I have gone ahead and entered a bug for this issue, as I would also expect the padded to power of two textures to have their sprites extracted correctly. For reference and tracking purposes the bug entered.

UE-21997

Thank you for taking the time to report this issue, and let me know if you have further questions or comments.

Thanks,

Thank you!

Still a problem with UE 4.15!

Please see the updated link to the bug report that was entered for this issue in my answer.

Still an issue in 4.24.3. Workaround is create the padded texture externally. I’m using Houdini’s PDG system to automate this as best I can.