No description
  • Java 84.6%
  • GLSL 15.4%
Find a file
2026-08-05 19:55:42 +02:00
gradle/wrapper Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
src Add low-end fog fallback modes 2026-08-05 19:55:42 +02:00
.gitignore Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
build.gradle Switch wrapping to WorldWrapController and cover it with gametests 2026-07-30 21:22:54 +02:00
gradle.properties Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
gradlew Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
gradlew.bat Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
LICENSE.txt Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00
README.md Add low-end fog fallback modes 2026-08-05 19:55:42 +02:00
settings.gradle Initial commit: ray-marched volumetric border fog with seamless wrap 2026-07-23 15:55:28 +02:00

The Fog Is Coming

A Fabric 1.21.11 mod that replaces the vanilla world-border force field with a custom Nebulon world effect and ray-marched shader. Walking into the soft white mist wraps the player to the opposite edge while its dense core hides the relocation.

Fog quality

On first client launch the mod creates config/thefogiscomming-client.json:

{
  "quality": "AUTO"
}

Valid values are AUTO, OFF, MINIMAL, POTATO, LOW, BALANCED, HIGH, and ULTRA. AUTO maps Fast graphics to Low, Fancy to Balanced, and Fabulous/Custom to High. Minimal is the non-volumetric fallback: it uses one closed-form, depth-aware fog interval with no ray-march loop or procedural fog noise. Potato is the lightest volumetric option, using four coarse steps, one fast-noise octave, and a shorter activation range. Low uses two fast-noise octaves and wider dense-core intervals for integrated graphics. All rendered tiers keep the same extinction density and opaque crossing seal. Balanced uses up to 16 ray-march steps and is the baseline profile for an M2 MacBook Air; the higher tiers retain the full 3D noise path and fine core sampling. Off removes the custom effect and restores the vanilla border wall and warning while leaving server-side wrapping active.

Fog LOD is continuous within every preset. Depending on the preset, the distant bank uses as few as four march steps and one broad noise octave, then introduces finer fluffy detail while the player approaches. Dense pixels stop marching as soon as they become opaque. Camera and depth transforms are supplied or reconstructed directly instead of inverting matrices per fragment.

Ray samples use screen-stable interleaved-gradient dithering and partial-step integration at scene surfaces. This turns the broad approach bands produced by a low step count into fine grain without the visible 4x4 tile, animated crawl, or contour shelves over terrain. The nearly transparent leading haze is marched coarsely, then sampling refines continuously toward the dense core.

For quick testing, -Dthefogiscomming.quality=minimal overrides the file for that launch.

Teleport integration API

Server-side mods can replace the built-in opposite-edge wrap by registering a resolver. Each crossing reports a normalized edge position: west/east run from north (0.0) to south (1.0), and north/south run from west (0.0) to east (1.0). A corner reports both edges.

BorderTeleportEvents.RESOLVE.register(context -> {
    BorderCrossing west = context.crossing(BorderEdge.WEST);
    if (west == null || west.progress() < 0.25 || west.progress() >= 0.50) {
        return null; // this mod does not own that part of the border
    }

    Vec3d destination = new Vec3d(100.5, 80.0, 200.5);
    return context.target(context.sourceWorld(), destination);
});

The first non-null target wins; returning null passes to later listeners and then the normal wrap. BorderTeleportContext.target preserves velocity, yaw, and pitch and accepts any ServerWorld, so the destination may be in another dimension. Alternate targets are exact and bypass the built-in terrain landing search.

Behavior

  • Nearby border sides are persistent Nebulon effects rendered by a custom batched EffectBatchRenderer.
  • The custom shader uses world-anchored multi-octave noise to form a broad white mist bank, a fluffy irregular approach, and an opaque crossing core.
  • A guaranteed inner veil conceals border-block silhouettes and the wrap, while scene-depth clipping keeps nearby foreground terrain correct.
  • Fog is composited after vanilla clouds and weather, so clouds cannot appear pasted over the mist.
  • Each proxy follows the camera vertically and along the border, keeping its feathered ends beyond the render sphere so it appears infinite.
  • A long smooth distance crossfade prewarms each side before it becomes visible, preventing border walls from popping into view.
  • Crossing either axis wraps to the opposite side. Corner crossings wrap both axes together.
  • Vehicles, passengers, velocity, yaw, and pitch remain together.
  • A small, non-persistent destination chunk ticket starts loading the opposite side only while the player is moving toward the border.
  • Grounded players search nearby loaded heightmap columns for dry, collision-free land instead of arriving inside terrain, over open air, or in water when a dry candidate is available.
  • Elytra, creative-flight, and spectator crossings preserve altitude and velocity; vertical adjustment happens only when the corresponding destination space is obstructed.
  • The destination remains inside the opposite fog bank, hiding chunk delivery and the teleport until the player walks out of the mist.