/*
 * Camera-relative spherical falloff used by the optional Animal Crossing
 * profile.  Keeping the function in camera space avoids precision loss at very
 * large world coordinates.  Only the Overworld calls it.
 */
vec3 applyNoxaraWorldCurvature(vec3 position) {
#if defined WORLD_CURVATURE && defined OVERWORLD && !defined NO_WORLD_CURVATURE
    float horizontalDistance = length(position.xz);
    float curvedDistance = max(horizontalDistance - CURVATURE_START_DISTANCE, 0.0);
    position.y -= curvedDistance * curvedDistance * (0.0015 * CURVATURE_STRENGTH);
    #endif

    return position;
}
