Repository navigation
water: fetch and lee, gusts, the sea lagging the wind, and currents, in both seas (O13) - #1311
Merged
Merged
Conversation
…in both seas (O13) - cvc::algo::wind_field: the scene's gusts as one deterministic function of (x, y, t): two scales of integer-hashed value noise carried downwind and ABYSSAL's pulse over time. cvc/gl/WindGLSL.h is the same in GLSL, no texture. Everything the wind moves (O14: the clouds, the trees, the air physics) can sample it at the same point and time. - cvc::ocean: fetch.h (the fetch map in one upwind sweep, coarse, capped by each body's extent; each cascade scaled by sqrt(F / F_full), F_full where its band is fully grown), sea_lag.h (the sea's wind follows with a time constant and steps by keyframes, at most one per crossfade), current.h (a divergence-free curl-noise current and a two-phase flow map). sea_surface takes a sea_forcing: the h0 crossfade, the fetch scales, the ripples' gust weight, the current. - Ariadne: scene_wind.h reads a node's wind in one place (O14 points it at wind.*). SceneWaterSeaClock steps the keyframes both seas use. New water keys: gustiness, lee, sea_lag, sea_fade, current (water_controls.ari, ARIADNE.md). - cvcGL: OceanWind (one RG32F texture of the two keyframes' fetch maps; the gusts and the current hashed per vertex). The water node and lsystem_coast draw the lee, the gusts (the ripples' weight, cat's paws in the shading), the current carrying the two short cascades, and mix the two keyframes' h0 on the CPU only while a crossfade runs. - Tests: ocean_wind_test (fetch behind an island and on a lake, the lag and its debounce, a continuous crossfade, golden hashes of the fetch map, the gusts and the current, a divergence-free current, the physics sea's lee and current), a floating crate in the lee against one in the open (ariadne_scene_world_test), the water node's new keys (cvcgl_ariadne_realize). No golden hash moved: a sea_surface without a forcing has the same digest and values as before.
transfix
enabled auto-merge (squash)
November 16, 2026 08:26
This was referenced Nov 16, 2026
physics, ariadne: one scene wind for the water, clouds and trees, and its push on bodies (O14)
#1317
Merged
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
The water node keeps both: #1311's lagged sea (keyframes, crossfade, fetch maps), gusts, cat's paws and current, and the persistent foam, A4 shading and level of detail. The far grid's cascade weights carry the lee, computed once a fragment and shared by its normal and the shading's unresolved slopes; the cat's paws darken the shaded colour as before. The foam's mean cover, roughness wind and windrow direction follow the sea's wind (its newest keyframe), as the whitecaps' thresholds already do.
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
This branch carried #1311's original commit (b6ab0c4), whose files are identical in the squash. The add/add conflicts (wind_field.h/.cpp, scene_wind.h/.cpp) and water_controls.ari take this branch's side, which is #1311 plus #1317's changes. docs/ARIADNE.md is a three-way merge on b6ab0c4 as its base, so master's later edits and #1317's both stand. Against master, the result is exactly #1317's own diff against b6ab0c4: the same 44 files and the same changed lines.
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
Conflicts: - THIRD_PARTY_NOTICES.md: both sides extended the ABYSSAL paragraph after OceanFFT.js. Kept master's gusts and currents sentence, then the storm deck's and the weather model's. The summary line now names the wind's gusts and currents (wind_field.h, current.h) beside the storm maps. - src/cvc/tests/CMakeLists.txt: both test loops list world_weather_test (this branch) and ocean_wind_test (master).
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
Conflict: - THIRD_PARTY_NOTICES.md, the ABYSSAL summary line: kept the storms merge's wind gusts and currents, and this branch's rain streaks. water_node.cpp merged cleanly. The water lighting's three O19 swaps still find their lines in #1311's shader, and vWaterRest is still there.
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
…ning Conflict: - THIRD_PARTY_NOTICES.md, the ABYSSAL summary line: kept the wind gusts and currents, the rain streaks and this branch's lightning bolts. water_node.cpp merged cleanly. The flash's swap into the water lighting still finds its line.
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
…#1305, #1310, #1311) #1305 gives each Runtime program-lane providers of its own (add_program_intrinsics), so two documents on one app no longer reach each other's verbs and host functions, and moves AppRuntime's provider there from the app's list. This branch had split that provider in seven, each registered on the app with its kind (S1-Q7). Conflicts in ariadne.h, app_runtime.cpp and ariadne.cpp keep both: - Runtime::add_program_intrinsics takes a kind too (the form without one is host_only, as register_action_intrinsics's), and the Runtime's own list keeps it. AppRuntime adds its seven providers there, each with the kind it had, in the same order. - install_providers runs any list by kind; the Runtime's own run after the app's, by the same rules, wherever an env is built: an action, a resident, a spawned child (finish_context), the names probe, and init: and a module's init: (every kind as it is, on their own thread). - host_only_bindings counts the Runtime's own host_only providers, so one that binds anything pumps the document's group on the host thread, as an app provider does. - add_program_intrinsics marks the placement stale, as a late host verb does. - The own list is read where an env is built, a spawned child's on its pumping worker, so it is under a mutex of its own (own_mutex), copied, and run unlocked; names_mutex no longer guards it. STATE_EXEC_THREADED.md: the Runtime's own providers, AppRuntime's seven among them, and the fourth late-registration path. Built locally (MSVC Release; AB.lock held the box, so the suites were not run here); a test of the own providers by kind follows.
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.
O13 of
docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md: fetch and lee (E2), gusts (E3), the sea lagging the wind (E4) and currents (E6, §10.3–10.4), in the drawn sea and the physics sea alike. Exit: the lee goes calm, and a wind change doesn't pop.What changed, and where
inc/cvc/algo/wind_field.h: the scene's gusts as one deterministic function of (x, y, t). It's two scales of integer-hashed value noise carried downwind (120 m gusts at the wind's speed, 37 m cat's paws at 0.8 of it), times ABYSSAL's pulse over time. It lives in cvc::algo so the water, the clouds, the trees and physics can all sample it.inc/cvc/gl/WindGLSL.his the same function in GLSL, with no texture.inc/cvc/ariadne/scene_wind.his the one place a node reads its wind; today that's the water node'swater.wind_speed,water.wind_dirandwater.gustiness. O14 points it atwind.*.inc/cvc/ocean/fetch.h. The fetch map is one upwind sweep over the shore grid (O(N²) for any wind), at most 256² and capped by each body's open extent. It's rebuilt only when a keyframe's direction moved, never per frame. Each cascade is scaled byclamp(sqrt(F / F_full), 0, 1), whereF_fullis the fetch at which that cascade's band is fully grown (see the decisions below).inc/cvc/ocean/sea_lag.h. The sea's wind follows the wind withwater.sea_lag(20 s) and steps along it by keyframes. Each keyframe crossfades from the last overwater.sea_fade(4 s), and there's at most one keyframe per crossfade. That's the debounce for the h0 and fetch rebuilds.sea_surface's newsea_forcing).inc/cvc/ocean/current.his the curl of two scales of noise: divergence-free, withwater.currentm/s as its RMS.sea_surface::velocitycarries the current, so a floating body drifts with the drawn small waves.SceneWaterSeaClock(scene_water.h) holds the keyframes that bothWaterRuntime(physics, headless too) and the drawn node read. Newwater.*keys:gustiness,lee,sea_lag,sea_fadeandcurrent. They're onwater_controls.ari, indocs/ARIADNE.mdand in the roadmap's "As built (O13)" notes.src/cvcGL/ocean/OceanWind.{h,cpp}holds the GLSL and per-frame uniforms, shared bywater_node.cppandlsystem_coast.cpp. The gusts and the current are evaluated per vertex (near grid 2 m, far grid coarse), and their fine detail fades with distance.THIRD_PARTY_NOTICES.md.How it was checked (Windows 11, MSVC Release)
ocean_wind_test(new, 10 tests):ariadne_scene_world_test,AWaterNodesLeeIsCalmerThanItsOpenWater(new): a 9 m/s wind past an island.lee: 0.Existing suites pass unchanged, and no golden hash moved: a
sea_surfacewithout a forcing has the same digest and values. That coversOceanSea.IsTheSameOnEveryPlatform, the lattice digest andPhysicsOceanSurface.CrossPlatformGoldenHash.water_controls.ariloads clean), WorldWaterBodies,cvcgl_ocean_fft,cvcgl_ocean_band,cvcgl_ariadne_realize(which now checks the new keys are seeded).Offscreen frames, looked at:
preset: island,edge: shore), from the downwind side: the water behind the island is glassy while the open sea beside it keeps its waves. On master the same view is rough everywhere.Frame cost: measured, but the measurement doesn't resolve it. terrain_lab,
arigl snapshotat 1280×720; each figure is the 720-frame run's time minus the 120-frame run's, over 600 frames. I ran seven rounds of master's arigl and this branch's, interleaved, with the order alternating. Three other agents were building and testing on the same machine (six compilers, ~66 % CPU), and the numbers swung widely:The per-round difference (branch − master) has a median of −9 ms and a spread of ±100 ms. So the change costs less than this machine could resolve today. The quietest round, 57.8 vs 49.0 ms, matches the roadmap's 54.9 ms on a quiet machine. A clean measurement (with GPU timer queries) is still to do, and so is the browser.
The design keeps the per-frame cost down:
Textures: one new sampler per water stage,
uWindFetch(RG32F, at most 256²). The gusts and the current are hashed noise in the shader. Each water stage goes from 8 samplers to 9:uDisp0–uDisp2, the bed,uShoreGrid,uShoreWave,uShoreDir,uWake, and nowuWindFetch, plus the cloud deck's shade where wired.For O14 (one scene wind)
scene_wind()ininc/cvc/ariadne/scene_wind.his the only reader of the water's wind. It readswater.wind_speed,water.wind_dir(degrees, the way it blows, from +x toward +y) andwater.gustinessthroughkWaterWindKeys. O14 points that function atwind.speed,wind.dirandwind.gustiness.wind_azis a compass azimuth;SceneWind::azimuth()converts.water.fetch,lee,sea_lag,sea_fadeandcurrentstay the water's own.cvc::algo::wind_gust(wind_state, x, y, t)(or agust_frameper frame) on the CPU, andcvc_wind_gust(p, fine)fromcvc/gl/WindGLSL.hin a shader. cloud_sky's drift, the trees and physics can sample it at the same (x, y, t) the water does.Not checked
texelFetch.water_bodies: not built, because there's no flow grid until hydrology (W1).sea_forcingis where they'd join the current.