geometry-sdf-techniques

Compute 2D Signed Distance Fields for coastline rendering with shader-based edge softening.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill geometry-sdf-techniques
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: geometry-sdf-techniques
Source: https://github.com/gregoryraymond/claude-agents-and-skills/tree/main/skills/geometry-sdf-techniques
Command: npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill geometry-sdf-techniques

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a continuous Signed Distance Field approach to coastline rendering, eliminating jagged boundaries and enabling smooth blending between land and sea in terrain visuals.

Core Features & Use Cases

  • Euclidean-distance coastline SDF generation for high-quality terrain blending in shader code.
  • Shader-based edge softening and multi-zone coastal transitions for realistic water/land delineation.
  • Offline generation strategies (CPU and GPU) including exact distance transforms and jump-flood methods to bake usable distance data into textures or per-vertex attributes.

Quick Start

Run the SDF coastline workflow by integrating SDF data into your terrain shaders to achieve smooth shoreline rendering and adaptive anti-aliasing.

Frequently Asked Questions about geometry-sdf-techniques

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I smooth jagged coastlines in terrain shaders?

A 2D Signed Distance Field smooths jagged coastlines by providing continuous distance data for terrain blending. It enables shader-based edge softening and multi-zone coastal transitions to produce smooth land-ocean boundaries in terrain visuals.

What is the best way to generate a distance field for terrain grids?

Distance fields for terrain grids can be generated using CPU-based exact Euclidean Distance Transforms, BFS seeding, or GPU Jump-Flood Algorithms. These offline strategies bake continuous distance data into textures or per-vertex attributes for shader integration.

How does fwidth anti-aliasing stabilize coastline rendering during zoom?

fwidth-based anti-aliasing stabilizes coastline rendering by adjusting edge softening based on screen-space derivatives. Combined with world-unit scaling, it ensures zoom-stable land-ocean boundaries across varying camera distances in terrain shaders.

Does GPU SDF generation work for large terrain grids?

GPU SDF generation works for large terrain grids using the Jump-Flood Algorithm to efficiently compute distance fields. This GPU approach supports world-unit scaling and produces distance data suitable for shader-based multi-zone coastal transitions.

Why do I need continuous distance data for coastline rendering?

Continuous distance data is needed for coastline rendering to eliminate jagged boundaries and enable smooth blending between land and sea. A 2D Signed Distance Field provides this data, allowing shaders to apply edge softening and realistic water-land delineation.