Transparent Viewports - aka Model Panels

Having the ability to have a 3D model on the screen and not in the game world anywhere that can render in respect to other UI UMG widgets with a transparent background.

The best I’ve gotten is using a 1x1 pixel viewport with FPreviewScene (otherwise the world doesn’t animate) setting a depth stencil value to be masked out to a Non-transparent render target, where both Chroma Key and opacity do nothing here… Then having another material poorly mask out a given color (with issues regarding texture blending and edges being miscolored) go into an image widget…

As far as I can see, there is no clean or nice way to do what I’m trying to do. (currently in 4.9)

What I currently have (right is viewport that will be 1x1 on screen somewhere):

Something similar that I’m trying to achieve: (Note both are in the UI not affecting the game)

Post process material: (Note, if alpha or chroma key in post process worked here, this would work how I want it to)

UI material: (Note: this would work if the sampler didn’t try to blend pixels [in the render texture neighboring pixels are ONLY 255, 0, 255, while in the sampler they are like 240 1 240 and variants])

This is only one example of this, and we plan to use this on many UI’s including our store.

This has been asked for a few times, unfortunately there’s no nice / self-contained way of displaying 3D Elements in the HUD atm. I guess you followed This Tutorial to do the above, but unfortunately the technique has nasty edge artefacts.

Since you’re using FPreviewScene, can you render the mesh in CustomDepth and mask out based on that instead? I’m not sure how or if FPreviewScene supports it but it probably does. Might be a good temporary workaround until we have 3D Mesh support in the UI.

FYI the reason this isn’t a feature yet is because you need different versions of the shaders for all the meshes… or something like that. They don’t have a nice way of doing that atm.

i dont know if thats helps, but check this

I started with that one for a proof of concept, but then I got hopeful when I found This One using depth stencil, but my guess is that it only works because hes masking with a black background and the blend looks ok… Unfortunately, we have black textures that need to be rendered.

Adding a mult 100 to the color in the post process then dividing it before final material color mostly removes all artifacting… Good find!!


This is a headeche.

The only solution I think we need render it in two pass, one for Color and another one for custom depth. Then change the final color’s alpha according to custom depth value. But without change Engine source codes it will be impossible to achieve.