void AtmosphereNoLoop(
    float samples,
    float expFactor,
    float rayLength,
    float dY,

    float mie_water,
    float Rayleigh,
    float estEyeDepth,
    vec3 refractedSunVec,
    vec3 ambient,
    vec3 sunColor,

    inout vec3 absorbance_w,
    inout vec3 vL_w
) {
    int i = int(samples);
    float d = (pow(expFactor, i / samples) / expFactor - 1.0 / expFactor) / (1 - 1.0 / expFactor);
    float dd = pow(expFactor, i / samples) * log(expFactor) / samples / (expFactor - 1.0);
    float attenuationDepth = dd * rayLength;

    // For Water

    vec3 rL_Water = water_coefficientRayleigh;

    vec3 ambientMul_water = exp(-max(estEyeDepth - dY * d, 0.0) * rL_Water);
    vec3 sunMul_water = exp(-max((estEyeDepth - dY * d), 0.0) / abs(refractedSunVec.y) * totEpsilon);
    vec3 mie_water_mult = mie_water * sunMul_water;

    vec3 mieScatterFactor_Water = dirtScatterCoef;
    vec3 ScatterCoeff_water = (totEpsilon + mieScatterFactor_Water);
    vec3 ambient0 = ambient * ambientMul_water * 0.75;

    vec3 rayleighContribution_Water = Rayleigh * rL_Water;
    vec3 mieScatteringContribution_Water = mieScatterFactor_Water * mie_water_mult;
    vec3 totalScatter_Water = rayleighContribution_Water + mieScatteringContribution_Water;
    vec3 sunContribution_Water = sunColor * totalScatter_Water;
    vec3 ambientContribution_Water = ambient0 * (rL_Water + mieScatterFactor_Water);

    vec3 light_water = sunContribution_Water + ambientContribution_Water;
    vL_w += (light_water - light_water * exp(-ScatterCoeff_water * attenuationDepth)) /
        (ScatterCoeff_water + safety) * absorbance_w;
    absorbance_w *= calculateAbsorbance(ScatterCoeff_water, attenuationDepth);

    vL_w = vL_w;
    absorbance_w = absorbance_w;
}