Cutaway shader with solid fill using stencil buffer

Trying to achieve this look [ATTACH=CONFIG]908[/ATTACH] using a cutaway shader with stencil buffer to fill in the clipped parts. The solid ground [ATTACH=CONFIG]907[/ATTACH] i use looks like this [ATTACH=CONFIG]906[/ATTACH] after clipping, notice the backfaces are also clipped. i don’t know how to apply the stencil solution discussed here Can anyone explain me how to do it in this case?