Download

CaptureSceneComponent using original scene's depth buffer

I’m trying to render a stroke brush over other meshes.
To achieve this I render a bunch of quads using a spherical brush and additive blending onto a texture (CaptureSceneComponent)

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_162991_1556196111535_4”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

I post-process the result using a color gradient based on the red value in the texture

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_162992_1556196113304_962”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

As you can see, the problem is the quads that should be hidden behind objects.

I’ve used Direct X in the past so I know you can simply use a new render target with the original scene’s depth buffer to solve this issue, I just can’t find a way to set this in unreal.

Is it possible using the current API? And if not, is there any other way to achieve this effect without capturing the entire scenes depth storing it in another texture, then sampling the depth buffer as this is very expensive.