Extrusion/Underground layer

Hi all, I’m trying to achieve an effect just like this one using cesium in Unreal for an AR experience where there is some “thickness” under the map

I’ve tried generating a height mask using a top down orthographic camera, then computing the difference between the height map and the cube’s pixels.

The problem with that method is that the mask doesn’t match the profile of the terrain (I wasn’t able to upload a picture of how this looks like). I was wondering if someone has tried to do something similar and if so, if I can get some guidance/tips on how to achieve it.

Thanks!