Repository navigation
Conversation
…-space shore march feat: flat shoreline strip with optional flow-mapped foam noise feat: Gods of the Arena water panel with every water parameter and colour pickers, behind -d:waterPanel change: Gods of the Arena lakes tuned to a deep turquoise change: GotA lake parameters can change at runtime Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #98. Reworks how
polyworld/watersfinds shorelines, and tunes Gods of the Arena's lakes.waters.nim): the per-pixel screen-space shore march is replaced by a distance field baked once per water layer from the terrain. The bake samples the visible ground (solid layers plus ground relief) at 4 samples per world unit over the water and an 8-unit margin; ground above the water's surface is land. An exact Euclidean distance transform (Felzenszwalb–Huttenlocher, columns then rows) stores each sample's distance to the nearest land in a filteredR16Ftexture. The water reads it once per pixel, so the shoreline is smooth, follows the visible bank, and no longer changes with the camera or rings units standing in the water. Fields are built lazily bydrawWaterBody;buildShoreFields()rebuilds them after terrain edits.shoreHeightis removed.foamDistancewide with a soft outer edge.foamNoise(0–1) breaks it into foam: tileable noise flow-mapped toward the shore along the field's gradient (the exact direction to the nearest shore), withfoamScaleandfoamSpeed. The shore fade still blends water and strip into the bank.GotaLakeWaterpreset (deep turquoise(0, 0.52, 0.77), colour strength 0.54, foam scale 1.22 and speed 0.1, fade 0.96 / curve 1.97).lakeWatereach frame, so they can change at runtime.-d:waterPaneladds a developer window (F4) with every water parameter, plus colour pickers (saturation/value square, hue bar, swatch and RGB sliders) for the water and shoreline colours. It isn't compiled into normal or web builds.Merged onto the renderer-performance rework (
captureScene,beginReflectionanddrawWaterBodycalled inline by GotA).Testing
tests/all.nim: CI tests passed-d:waterPanel,-d:headless), Light vs Dark, Call to Adventure🤖 Generated with Claude Code