First load of a texture that came from a SoftObjectPtr appears to be really small. Next times loading, it is the right size.

I was trying to load a texture from a SoftObjectPtr, but everytime I try assigning it to a UImage for the first time it appears really small. subsequent times, it is fine. I know this happens because on the very first async load, the texture does not yet have its final mip/size when UMG does its layout pass. Every time after that, the texture is already in memory, so the size is known early and UMG lays it out correctly.

So I tried using these functions that I’ve found that should potentially help me:

WaitForStreaming, InvalidateLayoutAndVolatility and ForceLayoutPrepasswere “supposed” to help, but I still have the issue…

For context, the image is inside a Scalebox because I want my image to keep its aspect ratio but stay within the constraints of its container (the scalebox).

It’s probably a MIP issue - like you self diagnosed.

Disable mips on that specidic texture - it’s about the only way. Everything else is basically an engine “feature”. Countless games out there that have this occurring…

This is a problem (feature) with widgets. It takes 1-2 frames after rendering for the geometry to become correct.

Hey, do you have a solution for this in blueprints? I have this issue in my project for almost 1 year. Soft texture references are always loaded so small. But if i start the game second time, or compile the widgdets before starting, it is being loaded correctly. This issue doesn’t appear in packaged game.

In that case, you have nothing to worry about (?) :sweat_smile:

You can work around this problem by creating a Blueprint with hard references to thet (and simmilar) assets and setting this Blueprint as the Primary Asset in the project settings. This way, it and everything it references will always be loaded.
You can also add this Blueprint to the “do not pack” list so that soft references work properly in the build.

In my case, what I decided to do in the end, is that I preloaded all the images I needed before adding them to the screen. Since I was opening the images as a secondary step to a new level/gamemode, I was able to async load all of the images I needed on first initialization of the mode, I would store them in a struct (or struct array) , then when it came time to open the images, they would already have been loaded.

This seems to work for my purposes for now…