It’s recommended you render another copy of the mesh. The other copy should have a fully opaque material, under render settings deselect render in main path and turn on render is custom render buffer. Then you can use that data for your needs either in the shader or as a postprocess.