I’ve recently wrote a custom MeshMaterialPass for my own use, working on version 4.26.2 from Epic’s github.
Everything works fine, except for one issue with the mesh rendering - each mesh is being rendered completely, instead of rendering only it’s visible parts.
It seems that I’m missing some z-depth test or something similar somewhere, but I can’t find out what & where.
I based most of my MeshMaterialPass and shaders’ code on the code for the CustomDepth Pass, the Depth Pass and the Depth shaders.
The main exception being my pixel shader, which receives a float4 color input as global variable, and only outputs the same value, without doing anything else.
I’ve added pictures of my original scene, and the same scene with the buffer visualization of my custom pass.
Will add more details of my shaders & code if needed.