It should be pretty straightforward, assuming those boxes are created from some other data source. If you have something like an array representing where boxes are, when creating a box, you can just check if each of the adjacent six sides also has a box - if so, set that face to invisible. Then you'll end up with only the outer faces of the 3D shapes set to visible across the entire level.