Example using a fragment's distance from the origin to determine its alpha value, with THREE.NodeMaterial.
See https://stackoverflow.com/questions/52425575/is-it-possible-to-let-fog-interact-with-the-materials-opacity?noredirect=1#comment91801899_52425575.