Filling the inner space of a mesh cutted with a slice material

I tried recreating this slice material ( ) in 4.24. It works fine except the filling part which makes the hollow parts of the mesh appear solid. I disabled ambient occlusion & cast shadows for the mesh as instructed. As the material tutorial was posted 2 years ago I’m wondering wether something in the engine has changed so the filling of the holes does not work anymore in that specific way.

The same effect is shown in a similar material in this video: 3D Printer Shader - Material Tutorial - [UE4] - YouTube

Any suggestions on how to achieve a solid rendering of the inner space of meshes? As we only need to cut along the z-axis I thought of a plane with a material that is only visible along the cuts of the mesh but calculating the inner space of the mesh via vertex positions seems not so efficient performance wise.