3d Transparency

Hey!

I have an application where I need to have transparency to see content rendered outside my app. I have it working for UMG, but now I need to have a hole in my 3d layer also.

I have a CineCamera and my idea is to add a post-process material. In the material I define x/y min/max boundary of the square hole (using same for UMG / 3d), and that part should then set alpha 0 to get the transparency. But I don’t get this to work for the 3d camera content…

In attached project there is a solid pink UMG layer with applied transparency (material M_2dTransparency) - through that I see the green surface captured by the CineCamera. In the CineCamera (PostProcess/RenderingFeatures/PostPorcessMaterials) the post-process “M_3dTransparency)” is applied. In the material I’ve tried some things, like setting EmessiveColor to 1,1,1,1 / 0,0,0,0, and also applying the hole. But none of these are making the content transparent - assuming I’m missing some setting?

Target setup is that I have a red background image rendered outside my app, this is seen when no 3d-content. So would expect this red to be visible in my hole.

Project has “r.Mobile.PropagateAlpha=1” set, CoPilot recommended these, “r.PostProcessing.PropagateAlpha=1, r.SeparateTranslucency=0, r.Tonemapper.MergeWithUpscalePass=0” also

[Attachment Removed]

Hey,

I think the issue here might be that the post-process material don’t work with transparency or (used as blending)? Trying to get this working with a render target solution instead…

Would want input what the best solution is.

Thanks!

//Jonas

[Attachment Removed]

Hi Jonas,

Can you confirm on which platform you are running? Assuming Android? Chipset?

Best regards.

[Attachment Removed]

Hi Stéphane!

​Target is QC SA8155 and SA8255, using QNX. So transparency working in UMG. Got it to work with a Screen capture and RT, don’t get the settings right (much darker and emissive colors don’t seem to work, switching between HDR/LDR settings).

Would prefer not to have a RT due to performance and complexity… I found a PostProcess setting (Blendable Location - Before Tonemapping) that I have not had time to test on target yet. But might have this limitation on brightness also?

//Jonas

[Attachment Removed]

Thanks. Can you confirm if you are targeting the GL or Vulkan RHI on target?

Best regards.

[Attachment Removed]

Hey there, sorry for the delay. We’re looking into this, will get back to you as soon as possible. Thanks!

[Attachment Removed]

Hi Jonas,

Can you share a screenshot of the graph of your post process material? I’d also check the details panel of that material to make sure alpha is enabled. We’ll take a look and see if anything jumps out.

Best,

Cody

[Attachment Removed]

We had a look at your post process material, and it does look like it isn’t using opacity so you’ll want to enable Output Alpha in the material. You’ll then need to provide something to the opacity output; you could try sampling opacity from the scene via the scene texture node. Let us know if you’re able to get that working!

[Attachment Removed]

GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 3.20

//Jonas

[Attachment Removed]

Hi Cody!

Pasted the material here: Transparency posted by anonymous | blueprintUE | PasteBin For Unreal Engine (available one week). Have tried a bunch of different things, but I’m not sure what’s relevant.

It’s a postprocess surface material I’ve added as blendable in a cine camera. I see that there is a “Output Alpha” in the material settings that is not checked… Guess it should be. Blendable location is “After tonemapping” and “Is blendable” is checked. Any other settings?

“r.Mobile.PropagateAlpha=1” is set previously (UMG transparency that works). And have now also set “r.PostProcessing.PropagateAlpha=1”

Thanks!

//Jonas

[Attachment Removed]

Hi,

Thanks for sharing that, we’ll take a look. In the meantime, I’ve collected some other thoughts from the team and summarized them below:

  • Since It’s working with a render texture, that suggests a lack of translucency support at the window layer might be the cause. You could test that by looking through FOpenGLViewport to see where the PixelFormat is being set, sticking a breakpoint in there, and checking if it has an alpha channel.
  • On QNX the only cvar you should need is r.Mobile.PropagateAlpha=1. It sounds likely that your post process material isn’t setting the final render alpha to 0, so you don’t get any punch through. I’m not sure we’ve used a post process material like this in the past, we’ve mostly used UMG widgets since it was easier to get the exact right alpha/shape. It should work in theory if you can get the material to really set the alpha channel in the final render, but it may take some testing.
  • A RenderDoc capture on the 3.1 mobile preview (Using your project) suggests that the post processing material isn’t cutting the alpha channel, so we’ll need to track down why. Your post process material may need a different output node (that one it has doesn’t look right for what you want) and the shader might need to be unlit
    [Attachment Removed]

Thanks Cody

Yes! So it was only this “output alpha”…

[Image Removed]Thank you!

//J

[Attachment Removed]