Drawing occluded pixels


I’m trying to figure out a little something.
I need to make a material that draws an actor the normal way, but then also draws the hidden pixels in a different color, possibly flat.

I tried looking around for this, but I couldn’t find anything, and I apologise if this question is actually a duplicate, but I looked for a similar question as well and I couldn’t find it.

Hi Funkbro,

I’m not entirely sure I understand what you’re trying to achieve, but it sounds like you may want to use a material mask to change only certain parts of your material. Are you trying to do this with a dynamic material where you would change it from within a blueprint?

Please clarify where you can with a better description or rough drawing.

Thank you!


Thanks for the response Tim,

Here’s an example of the effect i’m trying to achieve in my project.

The characters would render as an outline around their flat colour sillouhette when they are behind walls or are not visible by the camera. Any guidance towards achieving this would be greatly appreciated!

This can be achieved enabling the CustomDepth feature on the mesh (e.g. skeletal/static mesh). You can look into BufferVisualization to see the content of the CustomDepth buffer. Then you make a postprocessmaterial that colors pixels with an outline and fill. I think the Non photorealistic rendering project has some postprocess materials that show how to do an outline shader.