This is only an issue in 5.1 other version works as expected, I’m trying to capture an image of an object with a transparent background.
I’m using SceneColor (HDR) in RGB, InvOpacity in A
We also ran into this exact issue, except we are going from UE 5.0.3 to 5.1, so it seems this issue was introduced in 5.1. If rendering preview level is off, everything looks fine in the editor. But once we turn on the rendering preview or package to our targets (we target Android and iOS) this issue manifests itself.
This is happening to me too. Made a new project to test and it appears that the scene capture is not rendering out an alpha with Vulkan, Metal or ES3_1.
For now I’m using this post process inside the post process settings of the scene capture 2D to get the opacity to work, this also works in final color mode.
I’ve tried your workaround and still not working for us - the texture still does not have alpha (i.e., no checkerboard, only black). Out of curiosity, what is your target platform?
Your project works with alpha (as does ours), ONLY if no rendering preview is enabled. When setting the rendering preview to any mobile platform and deploying to device, the transparency isn’t there, so, I think there’s there’s probably an issue with the scene depth capture in Unreal.
I did/could not try with the D3D Shader previews - I’m on a Mac, and if I switch to those previews, Unreal crashes
Yeah it seems like the opacity of that post process is not taken into consideration at all in mobile. Hopefully someone can clarify if this is an issue with the engine or there’s some other way.
I’ve been running into this issue as well and think I’ve found out what’s wrong.
Looking in: Engine\Source\Runtime\Engine\Private\SceneTexturesConfig.cpp line 233
In FSceneTexturesConfig::Init → GetSceneColorFormat it picks a scene format based on r.SceneColorFormat - scene format 4 includes alpha but 2&3 do not - but if the view requires Alpha, overrides with RGBA (scene format 4).
The problem is that FSceneTexturesConfig::Init never copies over bRequiresAlphaChannel from the input settings, so this check fails because it never thinks it actually needs alpha.
I’ve seemingly fixed this locally by adding the following above the call to BuildSceneColorAndDepthFlags() in FSceneTexturesConfig::Init:
@essbuh Thanks for your post! I’ve cherry picked the fix to our 5.1 fork and it solved our problems. Amazing that you managed to track this down - thank you!!
I’ve had an issue with a night vision material on widget Camera “Plane” and in New 5.1.0 was not working at all and this setting “output Alpha” nailed it!. Thanks. (just to clarify with this setting un-ticked in 5.0.3 and previous versions it worked fine):
This technique only works correctly on the Blueprint in the Content Drawer, but it doesn’t work if the object is staged. In presence of another post processing for the scene with another post process material, the background remains black.
There are no Layers in Unreal?
Having worked for years with Unity, this is done easily through Layers.
Unreal is really behind in this one.