Download

Generate mipmaps of texture downloaded from the web

Hi all, I hope you can help me with this:
I am downloading a texture in runtime to use it as a texture. However, mipmaps are not generated, so there’s a moiree effect going on (texture is not smooth). Is there a way of generating mipmaps once the texture is downloaded using blueprints?

Thank you!

Make sure every single texture’s dimensions are in a power of 2 ALWAYS (Unless your using it as a spritesheet/palette or something.)

1 Like

Thank you for your help, Bits360. It’s already in power of 2, though (1024 X 1024). The same texture works fine if I import it manually through the editor.

I’m starting to think there’s no way of using an image downloaded at runtime as a texture…

I have a really janky idea that might work…

Render targets can generate mipmaps, and you can draw a material to a render target via the “Draw Material To Render Target” node.

Basically you get your download texture, put it into an emissive material. In blueprint, you create a render target with mipmaps enabled and then you try drawing the material to it. Then you would use the resulting render target in your final material. I’m not sure this will actually work though as I have never tried it.

1 Like

Hi Arkiras, thank you so much for your help.

It sounds complex, but it could work - I’ll try it as soon as I can.

I though render targets were a bit like rendering from a camera, am I wrong?

I believe that is correct, yes. But since it’s a static texture you only need to capture one frame. You may see a performance hitch when it does the capture though.

Unfortunately this is the only idea that I have so I’m not sure there’s any way to avoid that. Hopefully someone smarter than me will offer something less janky.

1 Like

As far as render targets go, this should be so simple that even the most basic tutorials on the subject are overcomplicated… I’ll give them a try later. Thanks!

1 Like

All the tutorials are severely over-complicated. To summarize converting a material to a texture, Make a plane, make an orthographic camera, with the height/width of the plane face the plane, use the output from the orthographic camera.

1 Like

Thanks a lot for that!

A render target is just a texture that’s drawn to; no camera is needed. To draw a texture to a render target, all you need to do is this:


It works :+1:, though I used the Draw Texture node instead.

2 Likes

Didn’t even know that node existed! Thanks for trying it, good to know it actually works

2 Likes

That’s great to know - thanks a lot for that!

1 Like

It works! The only problem is that, whenever I select Autogenerate Mipmaps and the texture is bigger than 256 px x 256 px, the render target gets all black! (see screenshots)