Download

Swapping textures in a dynamic material instance with preloading

I have a bit of a weird problem. I have a material fed with only one texture parameter. This texture will be swapped out and replaced with 10 different textures from a blueprint. When you press a button the blueprint will cycle through the images and display them on the mesh.

I have a slight problem though, and I am not quite sure where it’s coming from. When I press the button the image changes, but for 0.1 seconds the image is blurry and after that it returns to a normal state. It seems though as if it does not have enough time to finalize the image or something similar. So, does anyone know where the problem might lie? Can I preload the textures somehow?

The textures are 2048x2048, they have streming enabled and so on.

Cheers!

what you’re seeing is ue4 streaming in mips first, probably at 256 or 512, until it can load the full 2048. you could set a minimum mip level for it, or disable mipping, but that will cause aliasing problems at distance

Another option would be to create instances of the material and assigning them to the mesh.
Or try and use 2 materials and toggle between them (double buffer style), but Im not sure if that would make a difference…

Set two textures at once for material and lerp between them based on frame fraction. Or just don’t use second texture but this way engine is forced to stream it.