float ProceduralArtSun(vec3 viewDir, vec3 sunDir, float t)
{
    vec3 axis = abs(sunDir.y) > 0.99
    ? vec3(1.0, 0.0, 0.0)
    : vec3(0.0, 1.0, 0.0);

	vec3 right = normalize(cross(axis, sunDir));
	vec3 up    = normalize(cross(sunDir, right));

    vec2 uv=GetSunUV(viewDir,sunDir);
    uv*=1.4;

    float angle = t * 0.942;
    float c = cos(angle);
    float s = sin(angle);
    uv = vec2(c * uv.x - s * uv.y, s * uv.x + c * uv.y);

    float d = 0.1 / max(length(uv), 0.0001);

    float a = atan(uv.x, uv.y);

    float shape = 0.3 - 0.15 * sin(a * 12.0);
    shape = mix(0.3, shape, 0.75);
    float radius = 0.3 + 0.5 * shape;


    float facing = max(dot(viewDir, sunDir), 0.0);
    
	return smoothstep(radius - 0.05, radius + 0.15, d)*facing;

    
}

float ProceduralArtSunOutline(vec3 viewDir, vec3 sunDir, float t)
{
    vec2 uv = GetSunUV(viewDir, sunDir);
    uv *= 1.4;

    float angle = t * 0.942;
    float c = cos(angle);
    float s = sin(angle);
    uv = vec2(
        c * uv.x - s * uv.y,
        s * uv.x + c * uv.y
    );

    float d = 0.1 / max(length(uv), 0.0001);

    float a = atan(uv.x, uv.y);

    float shape  = 0.3 - 0.15 * sin(a * 12.0);
    shape = mix(0.3, shape, 0.75);
    float radius = 0.3 + 0.5 * shape;

    float facing = max(dot(viewDir, sunDir), 0.0);

    float sun = smoothstep(radius - 0.05, radius + 0.15, d);

    float outer = smoothstep(radius - 0.035, radius + 0.02, d);

    return max(outer - sun, 0.0) * facing;
}
