How to make an xray (sort of) Material? (not disable depth pass)

I currently have a floor mesh that I need to be able to see through down some stairs, no need for these to be walkable just visually represented. My current solution idea is some sort of Xray material that lets me see through the floor mesh, I currently tried a stair mess with an extended top step to the entire length of the stair (so think just a box basically) with a seperate material for this extended part and used the disable depth pass, but this creates some odd issues. I’m doing it this way since the stairs are of various sizes and placement’s within a procedual room. anyone have any ideas how I can create this sort of Xray material where its only see through at a selected part, i’ve attached a photo of my current setup of how the mesh’s are together. as you can see my idea was to have that large rectangle basically allow you to see through everything its colliding with to give the effect that the floor is cut out there.


I think using the Custom depth buffer could be helpful in your case. There is an example of something similar to what I think you would like to achieve here:
I am terribly new to UE myself but stumbled upon this during my research, so you probably have to ask any questions over there…


I’m not sure that would work since its basically visible though the entire mesh, nothing can block it other than that stencil, but since my floor is of a dynamic shape of any size i can’t just add a set image for that