#ifndef isReflectPass

float getCloudPhase(in float factor) {
    float phase     = dot(vec.view, mix(vec.light, vec.up, timeLightTransition))*0.5+0.5;
    return linStep(phase, 0.55*factor, 1.0)+0.5;
}
float getCloudPhase() {
    float phase     = dot(vec.view,  mix(vec.light, vec.up, timeLightTransition))*0.5+0.5;
    return linStep(phase, 0.55, 1.0)+0.5;
}

#else

float getCloudPhase(in float factor) {
    float phase     = dot(rvec.view, mix(vec.light, vec.up, timeLightTransition))*0.5+0.5;
    return linStep(phase, 0.55*factor, 1.0)+0.5;
}
float getCloudPhase() {
    float phase     = dot(rvec.view,  mix(vec.light, vec.up, timeLightTransition))*0.5+0.5;
    return linStep(phase, 0.55, 1.0)+0.5;
}

#endif
float c_miePhase(float x) {
    float mie1  = mie(x, 0.8*0.8);
    float mie2  = mie(x, -0.5*0.8);
    return mix(mie2, mie1, 0.75);
}