Dynamic texture with mipmaps

Hey there,

I have been using an extended WidgetComponent class to draw UMG-generated images unto normal objects. I had to extend the class to support drawing on Static Meshes rather than the generated quad. This works well, except since it draws on a RenderTarget, there is no Mip support, and the object looks bad and aliased from afar.

So I have been trying to allocate a 2D texture and copy the contents of the Render Target into it inside of the enqueued draw command from WidgetComponent (so this runs on the render thread). This also works, but breaks as soon as I try adding mipmaps to that texture.

1 - What is the correct way to allocate a dynamic 2D texture with mip support? I tried UTexture2DDynamic, it stops working as soon as I set NumMips > 1

2 - Do I then need to call RHICmdList.GenerateMips() on that texture after each copy from the render target? When I do that FD3D11DynamicRHI::RHIGenerateMips() asserts that the texture is not initialized properly.

I cannot find much code in the engine that does dynamic mip generation. Any tip welcome!

I am facing same problem.Did you solve it?

Same problem T^T