Stencil Buffer to render ground crack

Hi all, I started doing vfx in Unreal and came across an amazing difference between vfx in Ue and unity. In unity for more realism they use Stencil Buffer to create hole effect in landscape. Here is a video from unity that inspired me a lot. Click to see video

I started looking for Unreal guides and was very disappointed, in all youtube 1.5 guides on this topic, one of which is this one and that one doesn’t work. Video. This guide is an excerpt from a forum conversation I also read. In my version 5.4 this method didn’t work, so I downloaded 4.26 to test it there. Alas, it didn’t work there either, repeating the video tutorial one by one didn’t work for me. So I started looking for information on this method and was very disappointed that there is very little information even in the form of documentation.
Here are more different videos of Stencil Buffer in different engines.
Depth Stencil Masks, This showcase is very interesting, I would like to see more information on this, what method did he use to rule out rendering the floor in this area , I Learn About Stencil Buffers and Cutting Holes in Things

I’ll describe how I did it so you can understand. Suppose we have a model with polygons turned inward called “Crack” and its so-called “cover” that follows its shape called “CrackTop”. All settings, as I understood at that moment, should be done with the “lid”, because it is responsible for the display of the object.

As a result, I came to the conclusion that I need to understand the idea of Post Process (hereinafter PP), because my problem can be solved ideologically through the settings of rendering different objects. In the PP settings I tried to take the Custom Stencil parameter and use it as an alpha mask for the Lerp function, where in A the normal rendering of the scene was specified and in B the color was specified. As a result, I have an object with Stencil began to paint, but this is a third of success, because the main thing that I wanted to get is the display of color on the model Crack, because in the case of painting on Stencil I just had a model became as if with Emmisive enabled, without shadows and highlights.
Afterwards I started thinking that it would be nice to make an object with a certain stencil transparent, but alas, the post process can’t make anything transparent. As a fact, I want to have exactly the effect from this video, I really don’t believe that the feature-rich Unreal can’t handle such a task. I believe I’m just limited in my knowledge and I’m asking for your help with this problem. I’m not asking you to do it for me, I’m asking for an explanation or more documentation on this topic. I’m not afraid of code, so if there is a question that this is not possible to implement on regular Blueprints I’m ready to explore this topic in more depth.
Also I didn’t use Custom Depth at all, only to subtract from Scene depth, I’m sure and behind this parameter there is hidden potential that I couldn’t understand, I would need tutorials for that. For in this video the man is using Depth Mask and he doesn’t have the floor problem. Here is the video

Privacy & Terms