Repository navigation
generated_world: water as depth-coloured surfaces on the terrain chunks' LOD rungs - #1034
Merged
Merged
Conversation
transfix
force-pushed
the
feat/water-surface
branch
from
November 7, 2026 00:01
8216141 to
ca4deae
Compare
transfix
force-pushed
the
feat/water-surface
branch
from
November 7, 2026 01:07
ca4deae to
554adab
Compare
…ks' LOD rungs The water was one volume over the whole world (at most 320 columns across, 22 slices deep, a fraction of a percent opaque per metre), so water shallower than a slice barely drew, and its voxels were refilled on the CPU every four frames. Each terrain chunk now carries a water surface per rung (make_water_rungs): level at the water line over every cell with a corner under it, the terrain hiding it past the shoreline, each vertex coloured by the water column under it (water_colour: the bed absorbed red first, then green, so the shallows read sandy, then green, then deep blue). The generated_world node draws a ladder per wet chunk under <id>_water that switches rung with its chunk, opaque and casting no shadow, and drops the volume.
transfix
force-pushed
the
feat/water-surface
branch
from
November 7, 2026 02:17
554adab to
5028be4
Compare
transfix
added a commit
that referenced
this pull request
Nov 7, 2026
Bumps the project version and every recipe's upstream_version from 3.7.11 to 3.7.12. The v3.7.12 tag on this commit is the first release with the multi-car controller template (pycvc_gl.cars, #1031 #1035 #1040), the hidden-subtree fix in cvcGL (#1037), the discrete-gradient dyn_bike step (#978), semi-implicit Euler by default in the nav rollout (#981), the implicit contact damper (#1004, #1038), and generated_world's roads and water (#1032, #1034).
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.
Joe noticed the water areas didn't seem to have their volume rendering, and asked to rework the water for large worlds, the way the clouds were reworked. This is the first step. It's stacked on #1032 (roads, and the ground-texture flip that caused the phantom lakes); I'll rebase it onto master after that merges.
Why the shallows didn't show
VolumeNodeover the whole world: at most 320 columns across (35 m columns on the 11.2 km world) and 22 slices deep.The water as surfaces, per WATER-RENDERING-ROADMAP's W1. For uniform water, a closed surface gives the same image as a volume, at a cost that falls with distance and screen size; a volume's doesn't.
cvc::world::make_water_rungsbuilds a water surface for each terrain LOD chunk, on that chunk's own rungs. It sits level at the water line over every cell with a corner under it. Drawn with the terrain, it's hidden exactly where the ground rises out of the water, so there's no shoreline to extract and none to move when a rung changes.water_colour(depth): Beer-Lambert absorption of the bed's light, down and back up, with red absorbed first, then green, then blue (0.45, 0.065, 0.035 per metre), and the water's own blue filling in. It's baked per vertex, so the shallows read sandy, then green, then deep blue.generated_worldnode draws a ladder per wet chunk under<id>_water. It switches rung with its chunk, is opaque, casts no shadow, and has a sun glint (specular 0.6, power 80).water: 0leaves the water out.Checked
world_generated_test:WaterColourDeepensWithDepth.WaterRungsCoverTheWetCells: on a pit, rung 0 covers exactly the wet cells, at z = level, coloured by depth; coarser rungs have fewer cells; a dry chunk has none.TheWaterIsDrawnWhereverItIs: every cell of the generated world under the water has a surface over it.cvcgl_ariadne_realize: surface ladders per wet chunk, five rungs each, casting no shadow; every chunk's water switches rung with its ground.Next, from the roadmap's W1/W2 and the clouds' example: