Rendering Widget to Texture for Material Manipulation

Hi all,

So my end goal is is to produce a transition effect for my widgets/subwidgets when opening/closing windows. In order to do this I plan to apply material functions which I mostly have set up and working. The issue is that I’ll need to generate an image of the panel I want to transition so I can manipulate the image with the jazzy transition stuff, then replace it with the real, interactive widget when the transition finishes.

I’ve been looking for a way to render a given widget to a texture/render target but I can’t find any information about that. Is there a way I could do this, or might there be a different way of achieving what I want?

Cheers

You should take a look at the new retainer box widget from 4.11/4.12.
It is a widget component which renders its children into a buffer and then applying this buffer to the UI.

The main purpose is optimisation by controlling its refresh rate. I.e. render only every third frame. This can be controlled in Details > Phasing of the Widget.

The retainer box allows to apply a material for postprocessing the buffer before rendering. I think you could be able to implement your jazzy transition with a dynamic material. This can be found under Details > Effect.

If you have the UWidget in a UWidgetComponentthere’s a really easy way to get access to the texture: UWidgetComponent::GetRenderTarget()