Download

Using capture component 2d for ui widget

Hi everyone,

I am trying to make an UI with few static mesh element displayed on screen for a level editor.

I found out about capture 2d component, i placed one over one of my static mesh in the level, created a render target texture so i can display it in my ui widget, but the problem is that my texture has a background, it does not just capture the static mesh despite using the “show only actors” array.

I tried to place a sort of “green screen” behind the static mesh and create a material to turn the color transparent, but i don’t know anything about materials.

It’s a fairly easy trick. In the editor-window select the syke (SkySphereBlueprint) and press F. It will zoom you out very far. In this area you will place the capture 2d facing away from the round skybox (this is importend). The actor or mesh you place out there will stand in front of nothing or in front of an transparent wall. Capturing that will result in seeing only the mesh.
The material is very easy. Just create one and set the “Material-Domain” to “User Interface”, drag in your render target and connect the color from that to the final color. You have to plug in the alpha (last pin on the texture sample node) to the opacity with a “OneMinus” node between them. You can render this material in the widget.

Thank you man, it works, i didn’t have to move anything outside the skySphere though, i just used the showOnlyActors array available on the sceneCapture2D component and with the alpha oneMinus on the material, it worked perfectly.

Thanks again.