3x3 Sobel normal gradient convolution for procedural coastlines
To highlight continental boundaries and island archipelagos without adding heavy vector geometry, TerraGemini applies a discrete Sobel convolution filter across the 4K raster landmass mask :
The normalized edge magnitude is computed per vertex:
Dynamic Shader Coastline Modulation
In the vertex and fragment shaders, the uniform u_edge_sensitivity dynamically scales point size and brightness along coastlines:
float threshold = 1.0 - (u_edge_sensitivity * 0.85 + 0.08);
float edgeFactor = smoothstep(threshold, 1.0, a_edge_strength);
gl_PointSize = clamp(baseSize * fresnel * (1.0 + 1.6 * edgeFactor * u_edge_sensitivity), 1.0, 64.0);This emphasizes continental boundaries while preserving smooth, anti-aliased transitions under high-speed globe rotation.