Calculate visible percentage of an object

I’d like to calculate the percentage of an object that is visible in screen space. Basically I have some spheres that pass in front of each other, and I’d like to calculate for any given sphere how much of it is hidden/visible. Any tips on how to do this efficiently are appreciated.