# Screenshot with customdepth as alpha, In Shipping build (C++)

**URL:** <https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781>\
**Category:** Rendering\
**Tags:** transparent, unreal-engine, UE4, CPP, question\
**Created:** [December 19, 2018, 8:14am UTC](https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781 "2018-12-19T08:14:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_67fd1278](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_67fd1278](https://forums.unrealengine.com/u/anonymous_user_67fd1278)\
**Post date:** [December 19, 2018, 8:14am UTC](https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781/1 "2018-12-19T08:14:10Z")

</div>

Hi, I am trying to recreate an editor-only function (HRSS) for a shipping version of the project. The following code functions during PIE but not when packaged.

```
GetHighResScreenshotConfig().bMaskEnabled = true;
GEngine->GameViewport->Viewport->TakeHighResScreenShot();

```

This is probably because of the #if WITH\_EDITOR condition in HighResScreenshot.cpp on line 46 which uses some editor only classes/material to create and merge the mask which is generated in the custom depth buffer.

So is there a way around this without modifying the engine? Or do I need to recreate most of the functionality to get it working in the client. I am hoping it possible to access the render buffer to get the customdepth pass and pass it into the highres screenshot class when it comes to merging the two textures together

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bf9de05a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bf9de05a](https://forums.unrealengine.com/u/anonymous_user_bf9de05a)\
**Post date:** [January 10, 2019, 2:55pm UTC](https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781/2 "2019-01-10T14:55:04Z")

</div>

Did you make any progress on this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_67fd1278](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_67fd1278](https://forums.unrealengine.com/u/anonymous_user_67fd1278)\
**Post date:** [April 21, 2020, 9:46am UTC](https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781/3 "2020-04-21T09:46:08Z")

</div>

Sorry for the slow reply, I didnt make much progress with this. It seems like it required some engine modification to get the function working in runtime, or some workaround setup using render targets and texture composition

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [April 21, 2020, 11:39pm UTC](https://forums.unrealengine.com/t/screenshot-with-customdepth-as-alpha-in-shipping-build-c/439781/4 "2020-04-21T23:39:51Z")

</div>

Only way to do it is either enigne modification or redoing, study the code in engine and try to reproduce. There might be real reasons why #if WITH\_EDITOR is there, most likely use of editor API or knowing UE4 RHI code there might be linking issue due to compromises made to speed up linking process. If you study code you most likely find reason why is that the case
