• Compute the normalised sky factor for a cell, given how many of its n cosine-weighted hemisphere samples were visible (escaped the scene without hitting an occluder) and the cosine of the zenith angle of each visible sample.

    Result is in [0, 1]1.0 means the cell sees the full unobstructed sky under the chosen model, 0.0 means the cell is entirely roofed over.

    The Monte Carlo estimator is derived from

      E_horiz = ∫ L(ω) · cos(θ) 
    ≈ (π/n) · Σ L(ω_i) (cosine-weighted PDF)
    SkyFactor = E_horiz / E_horiz_unobstructed

    The E_horiz_unobstructed analytic for each model is:

    • Uniform : π · L → factor reduces to visible / n
    • CIE Overcast : (7π/9) · L_z → factor is 3 · Σ(1 + 2·cosθ) / (7n)

    Both are azimuth-symmetric so cosTheta is all the information needed per sample.

    Parameters

    • model: "uniform" | "cie-overcast"
    • n: number
    • visibleCosThetas: number[]

    Returns number