# UE 5.1 SceneColor in SceneCapture2D not capturing opacity

**URL:** <https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495>\
**Category:** Rendering\
**Tags:** Scene-Capture, unreal-engine, UE5-1, Rendering, question\
**Created:** [November 15, 2022, 9:58pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495 "2022-11-15T21:58:06Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [November 15, 2022, 9:58pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/1 "2022-11-15T21:58:06Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/7/76731f257813c77f6a8b8685d26ed69c94aa947e.png)

In the material I do this, the result here is nothing displayed

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/8/b980abff5f489cbe86e822926e9d2764779e58fe.png)

If I plug Alpha directly

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/5/dc58b6118759aee67714b315d275e31cffa4149a.png)

I get a black background which explains why I get nothing in the first example because alpha is always 1

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/e/c2e858f18de271ac8bb541b741bdcc8b6002e7da.jpeg)

In other versions it’s working as intended but in UE5.1 I get a solid black color instead.  
The image below is how it should be, this is in 4.27

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/5/f65c3483c2f18f9ef56c0f6080c86d0677d8ee3b.png)

Any help would be appreciated it, thank you.

---

<div class="post-metadata">

**Author:** ![smg-stang](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smg-stang/32/88715_2.png) [@smg-stang](https://forums.unrealengine.com/u/smg-stang)\
**Post date:** [November 18, 2022, 1:11am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/2 "2022-11-18T01:11:28Z")

</div>

Hi there,

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.

In the 5.1 release notes [https://docs.unrealengine.com/5.1/en-US/unreal-engine-5.1-release-notes/](https://docs.unrealengine.com/5.1/en-US/unreal-engine-5.1-release-notes/) , there’s a bit saying:  
`Scene Capture render targets now start with the alpha channel disabled`

Not sure what that means and if it’s related to this issue. We’ve fiddled with many settings to see if we can “enable” alpha again, but to no avail.

---

<div class="post-metadata">

**Author:** ![ZeroCan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zerocan/32/594590_2.png) [@ZeroCan](https://forums.unrealengine.com/u/ZeroCan)\
**Post date:** [November 18, 2022, 4:36am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/3 "2022-11-18T04:36:44Z")

</div>

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.

 ![RenderTargetBug_3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/f/8cfaa07929925533eb82abf757afc689e3684857.jpeg)

---

<div class="post-metadata">

**Author:** ![smg-stang](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smg-stang/32/88715_2.png) [@smg-stang](https://forums.unrealengine.com/u/smg-stang)\
**Post date:** [November 18, 2022, 7:05pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/4 "2022-11-18T19:05:26Z")

</div>

Another clue:

- I’ve tried disabling `Mobile HDR`, and the transparency is captured again, but the captured textures’ colours are all washed out.

We most likely don’t want to disable mobile HDR, but hopefully another clue to what’s going on.

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [November 19, 2022, 7:18am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/5 "2022-11-19T07:18:56Z")

</div>

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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/7/d872d66040fafdcd20f458bc97f39dccdc582780.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/d/d2d1730e57c0d16e243d6a696890d4e40d52d817.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/a/4dab4118361233246a55fe0fe3261316db34897b.png)

I’m still curious about what changed and how to make it work like before but at least this is another way to solve it.

---

<div class="post-metadata">

**Author:** ![smg-stang](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smg-stang/32/88715_2.png) [@smg-stang](https://forums.unrealengine.com/u/smg-stang)\
**Post date:** [November 21, 2022, 11:18pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/6 "2022-11-21T23:18:39Z")

</div>

Hi @KaidoomDev,

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?

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [November 22, 2022, 4:01am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/7 "2022-11-22T04:01:38Z")

</div>

Here’s a quick small project with it working.  
[SceneCap.zip](https://forums.unrealengine.com/uploads/short-url/4jMGocxJG0LnB0pHGFpweO2mqqQ.zip) (40.4 KB)

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/f/c1f61ac5e6a84cf948a30d52dc79774a885fb884.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/f/c1f61ac5e6a84cf948a30d52dc79774a885fb884.mp4)

Let me if you have any questions.

---

<div class="post-metadata">

**Author:** ![smg-stang](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smg-stang/32/88715_2.png) [@smg-stang](https://forums.unrealengine.com/u/smg-stang)\
**Post date:** [November 22, 2022, 10:30pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/8 "2022-11-22T22:30:01Z")

</div>

@KaidoomDev - Thanks for the project.

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 🤷‍♂️

Android Vulkan/IOS SM3\_1:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/5/a05052fa94e370fac6fc2d5f89a3f367bf1a488d.jpeg)

Preview Rendering Level disabled:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/d/84d136b7f48394f69df0b7721736eaa99531ed3e.jpeg)

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [November 23, 2022, 11:04am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/9 "2022-11-23T11:04:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [November 25, 2022, 5:00am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/10 "2022-11-25T05:00:59Z")

</div>

So in my case I found a clue, I have effects set to medium in scalability settings, if I set it to epic it works as expected.

Edit: Found the cvar, it’s r.SceneColorFormat in epic scalibility it’s set to 4

---

<div class="post-metadata">

**Author:** ![essbuh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@essbuh](https://forums.unrealengine.com/u/essbuh)\
**Post date:** [November 25, 2022, 2:15pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/11 "2022-11-25T14:15:28Z")

</div>

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`:

```auto
	bRequiresAlphaChannel = InitSettings.bRequiresAlphaChannel;

```

Scene capture now renders as expected no matter what my **r.SceneColorFormat** is set to

edit: Looks like a fix for this is already submitted in ue5-main ([https://github.com/EpicGames/UnrealEngine/commit/c17ed2eeb2d2ea957bdd6b65af9de57ba6754490](https://github.com/EpicGames/UnrealEngine/commit/c17ed2eeb2d2ea957bdd6b65af9de57ba6754490)), hopefully it makes it into a 5.1 hotfix

---

<div class="post-metadata">

**Author:** ![smg-stang](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smg-stang/32/88715_2.png) [@smg-stang](https://forums.unrealengine.com/u/smg-stang)\
**Post date:** [November 30, 2022, 1:33am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/12 "2022-11-30T01:33:51Z")

</div>

@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!!

---

<div class="post-metadata">

**Author:** ![michailmarkou1995](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/michailmarkou1995/32/465567_2.png) [@michailmarkou1995](https://forums.unrealengine.com/u/michailmarkou1995)\
**Post date:** [December 28, 2022, 8:20pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/13 "2022-12-28T20:20:31Z")

</div>

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):

Before NightVision is Set to ON

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/2/7923d9350b47c0dc5593dd19e0aa2270a1c2e47f.jpeg)  
After NightVision is Set to ON with no Output Alpha ON  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/3/6838485c1f8801c785013d85881803b33f295a91.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/a/5ea6ca019a1d054580ee787891855e653a744f52.jpeg)  
After NightVision is Set to ON with Output Alpha ON  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/3/6a3554a8f0138632c34d4016d020ad53ccf50a28.jpeg)

---

<div class="post-metadata">

**Author:** ![MichailMenes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MichailMenes](https://forums.unrealengine.com/u/MichailMenes)\
**Post date:** [January 24, 2023, 7:57am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/14 "2023-01-24T07:57:31Z")

</div>

Thank you, bro! This work with my project! 💙

---

<div class="post-metadata">

**Author:** ![WILEz-AM](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wilez-am/32/622175_2.png) [@WILEz-AM](https://forums.unrealengine.com/u/WILEz-AM)\
**Post date:** [February 20, 2023, 5:57am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/15 "2023-02-20T05:57:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joy\_Network](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joy\_Network](https://forums.unrealengine.com/u/Joy_Network)\
**Post date:** [May 19, 2023, 4:45pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/16 "2023-05-19T16:45:04Z")

</div>

Biiig! Thank you, it was that cvar preventing my Post Process to output alpha.

---

<div class="post-metadata">

**Author:** ![0b99a19b9b554e578b2f44ba67fc40bc](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/0b99a19b9b554e578b2f44ba67fc40bc/32/912584_2.png) [@0b99a19b9b554e578b2f44ba67fc40bc](https://forums.unrealengine.com/u/0b99a19b9b554e578b2f44ba67fc40bc)\
**Post date:** [September 6, 2023, 1:08am UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/17 "2023-09-06T01:08:04Z")

</div>

How to find cvar?,I call “Get Game User settings”,and can’t find “cvar”.

---

<div class="post-metadata">

**Author:** ![Oldmanriver1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oldmanriver1](https://forums.unrealengine.com/u/Oldmanriver1)\
**Post date:** [August 29, 2024, 3:54pm UTC](https://forums.unrealengine.com/t/ue-5-1-scenecolor-in-scenecapture2d-not-capturing-opacity/691495/18 "2024-08-29T15:54:16Z")

</div>

2024 and this is still the fix. Thanks my dude!
