class function NearFarToSkySphereRadius(const zNear, zFar: Single; const Proposed: Single = 0): Single;
Calculate (or just confirm that Proposed value is still OK) the sky sphere radius that fits nicely in your projection near/far.
Background spheres (for sky and ground) are rendered at given radius. And inside these spheres, we have a cube (to apply background textures). Both spheres and cube must fit nicely within your projection near/far to avoid any artifacts.
We first check is Proposed a good result value (it satisfies the conditions, with some safety margin). If yes, then we return exactly the Proposed value. Otherwise, we calculate new value as an average in our range. This way, if you already had sky sphere radius calculated (and prepared some OpenGL resources for it), and projection near/far changes very slightly (e.g. because bounding box slightly changed), then you don't have to recreate background — if the old sky sphere radius is still OK, then the old background resources are still OK.
Just pass Proposed = 0 (or anything else that is always outside the range) if you don't need this feature.