float phaseT(float t, float start, float end)
{
    return clamp((t - start) / (end - start), 0.0, 1.0);
}


float phaseSmooth(float t, float start, float end)
{
    float x = phaseT(t, start, end);
    return x * x * (3.0 - 2.0 * x);
}

float SunrisePhase()
{
    float t = worldTime;

    float rise = phaseSmooth(t, 23000.0, 24000.0);
    float fall = 1.0 - phaseSmooth(t, 0.0, 2000.0);

    return max(rise, fall);
}
float NoonPhase()
{
    float t = worldTime;

    float rise = phaseSmooth(t, 0.0, 2000.0);
    float fall = 1.0 - phaseSmooth(t, 9000.0, 12000.0);

    return rise * fall;
}
float SunsetPhase()
{
    float t = worldTime;

    float rise = phaseSmooth(t, 9000.0, 12000.0);
    float fall = 1.0 - phaseSmooth(t, 12000.0, 12750.0);

    return rise * fall;
}
float MidnightPhase()
{
    float t = worldTime;

    float rise = phaseSmooth(t, 12000.0, 12750.0);
    float fall = 1.0 - phaseSmooth(t, 23000.0, 24000.0);

    return rise * fall;
}
float rain_time(){
    return smoothstep(0.0,1.,rainStrength);
}