Rendering occluded geomerty

I a trying to create postprocess to render an object which is down on the scene on top of everything.

I planning to use custom depth to the UI object for. And I got a bit promising effect but the problem is I am not able to get the original colour which I was using. Nor I am able to get it worth with translucent materials.
Any method by which I can get the colour of the original object along with translucency? I am currently using a masked material.


Translucent material are not rendered to custom depth. You can either do what I did and modify the engine to include them or have a duplicate mesh with a basic non translucent material and uncheck “render in main pass” for the duplicate. This will stop the duplicate mesh from being visible but will allow it to be rendered to the custom depth buffer.

Okay I made the 2nd object go through the render pass and the customDepth Stencil Value 3.
What should I do next, How to get it to render in the location of the other stencil mask?


Sorry I just realised what you are trying to acheive.

Forget about using custom depth and a postprocess. Instead just enable ‘disable depth test’ on your translucent material.

Not its slightly tricky compared to what I am trying to achieve. There is a 2nd type of object in game with would always overlap on this.

So these Indicators overlap everything. But the 2nd type of object, that would work normally but go over these indicators. So 1 need 2 objects in 2 stencil buffers.


Hi Envenger did you ever figure this out? Trying to do Ability User Interface like you. Decals sort of work…but are messy and conform to terrain.

Actually I figured this out Envenger:

  • Use custom stencil, enable it for the actor you want on the top top(the hero)
  • Make a material for the user interface, a regular surface material. It has a base texture which is the user interface design. But for the opacity, have it grab from custom stencil, bit mask it to check for the hero’s bitmask, and then do a (1 minus) node to inverse it, then hook that up to opacity.
  • Set this material to “Disable Depth”
  • Apply the material on a plane geometry
  • Put the plane geometry at the feet of the hero actor

You’re done