vec2 GetSunUV(vec3 viewDir, vec3 sunDir){
	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;
    uv.x = dot(viewDir, right);
    uv.y = dot(viewDir, up);

	return uv;
}

vec2 GetMoonUV(vec3 viewDir, vec3 moonDir)
{
    vec3 axis = abs(moonDir.y) > 0.99
    ? vec3(1.0, 0.0, 0.0)
    : vec3(0.0, 1.0, 0.0);

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

    return vec2(
        dot(viewDir, right),
        dot(viewDir, up)
    );
}
