3d UMG widget - capture 2d with green screen causing memory errors and poor keying

Hello all,

I spent time researching the best way to get 3d art in a GUI and saw two ways.

The cleaner of the two had an alpha issue that from what I could tell no one could work around and the author never responded, Scene capture component does not have alpha by default, I don’t know why his did. Anyways, I moved on to using a green screen.

Render 3D objects in UMG Widget/HUD | EngineUnreal This worked but I’ve gotten a memory error crash capturing and rendering at 1920x500 and more importantly the keying of the asset leaves a really bad green stroke (see attached img).

If anyone has input or suggestions that’d be really helpful as I’m pretty out of options at this point. Thanks!

EDIT: The screen cap of the green outline is not comign through well, take my word for it, each pixel of green that was not keyed is bright green and looks terrible.
EDIT2: Sorry, this is the actual key method im following:

I’m trying to fix this by using the custom depth buffer…slow going.

EDIT: leaving this post as a reference, see my other post below for a better solution…

Hey there,

The article you linked mentions the UMG scaling has to be off or you get the outline.

A hack I just tried is to wrap your image into a scalebox (in your UMG widget), and set the Stretch variable to “User Specified”. Then in the EventConstruct do:


It should render correctly but will unscale your image and it will be independant of the UI so you might have to figure out how to move your render camera based on the UI scale of the device or something. Sorry I didn’t try that far.

Hope this helps. Be sure to post back if you find a proper solution :stuck_out_tongue:

Sorry about the double posting, I found another solution which seems to work well in my test case.

I removed the background altogether and added only the models i wanted to render into the “Show Only Actors” array of the SceneCapture2D… This gave me the reversed alpha that you saw in that video you posted, so in your Material just do a OneMinus on the Alpha.

In my case I had everything in a seperate blueprint I could spawn on demand, not sitting in the level, so I added it in blueprints like this: