# Jagged edges on scene depth mask used to render 3D in UMG

**URL:** <https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771>\
**Category:** Rendering\
**Tags:** scenecapturecomponen, Post-Processing, unreal-engine, question\
**Created:** [December 20, 2016, 6:39am UTC](https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771 "2016-12-20T06:39:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![serulas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@serulas](https://forums.unrealengine.com/u/serulas)\
**Post date:** [December 20, 2016, 6:39am UTC](https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771/1 "2016-12-20T06:39:05Z")

</div>

Hi all,

I am trying to render 3D objects in my HUD. I have an UMG that gets drawn to the HUD. This UMG includes two images, one for a gray background and another for the material that has my object’s RGB and the mask.

The 3D object is in my scene with a camera and two SceneCaptureComponent2Ds pointing at it. One for color one for masking.

I placed a scenecapture2D and made a post process material for it following some tutorials.  
Here is the material

 ![119359-postprocessmat.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/e/19e2c8aadb5792bfae0e344608b2b8422e68fd12.png)

This gives me the mask I use for the opacity channel.  
For the color channel, I used a 2nd capture, not set to depth but set to RGB.

Here is where I use one for the opacity and one for the color:

 ![119372-umgmat.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/7/427cf794ee6a8e784ad6e20365a5a5611fab8fc5.jpeg)

Here is my problem, note the edges:

 ![119360-edges1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/d/d6d39930d6b129db671a9cc59373fd1b92ccce8e.png)

All my RenderTextureTargets are 1024 and are drawn as 1024 images in my UMG. I also tried 2k and other options to no avail.

All help appreciated,  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![S-ed](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/s-ed/32/1194558_2.png) [@S-ed](https://forums.unrealengine.com/u/S-ed)\
**Post date:** [December 30, 2016, 11:00pm UTC](https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771/2 "2016-12-30T23:00:02Z")

</div>

Make background of the object - black.

It is the clouds color what is leaking through border of the mask.

---

<div class="post-metadata">

**Author:** ![serulas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@serulas](https://forums.unrealengine.com/u/serulas)\
**Post date:** [January 1, 2017, 9:58pm UTC](https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771/3 "2017-01-01T21:58:27Z")

</div>

Thank you! I deleted everything that gave any kind of color to my sky, now that it has a black background, nothing is leaking in.

Cheers!

---

<div class="post-metadata">

**Author:** ![TuanZ2z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TuanZ2z](https://forums.unrealengine.com/u/TuanZ2z)\
**Post date:** [August 17, 2022, 3:09pm UTC](https://forums.unrealengine.com/t/jagged-edges-on-scene-depth-mask-used-to-render-3d-in-umg/379771/4 "2022-08-17T15:09:31Z")

</div>

hello, serulas.I have the same need as you. can you tell me what tutorial you are watching, thanks.
