Repository navigation
ocean: the physics band residual, M chosen; OceanFFT's scissor and Nyquist fixes (O7b) - #1149
Merged
Merged
Conversation
…quist fixes (O7b) cvcgl_ocean_band runs lsystem_coast's three cascades on the GPU (OceanFFT at 256^2, read back) against cvc::ocean::sea_surface on the CPU at several band sizes and prints the residual table. It found two OceanFFT bugs first: - The renderer leaves the scissor test boxed to the window, so in a window smaller than the FFT every pass was clipped to the window's corner (the long cascades came back flat). OceanFFT now disables it for its passes and restores it afterwards. - The Nyquist row and column have no -k partner, so the packing leaked the slope field into the height there (a faint checkerboard in the 29 m cascade). OceanFFT drops them, as the CPU does. With every mode the CPU's twin is the GPU to 0.0005 %. The drawn sum's floor is the shader's own nearest-texel sampling, which took the texel at or before each point and so trailed the field by half a texel: 106 mm RMS. lsystem_coast's oDisp now takes the texel nearest the point (and the shore check samples the same way), which halves that floor to 47 mm; the shore check still finds no vertex on dry ground. M chosen: 64 modes on a 64 lattice (band_params' new default) misses the drawn sea by 3.99 % RMS, within 6 % of the 3.78 % floor; 32 modes miss by 4.41 %. The harness holds the default within 1.1 times the floor.
transfix
enabled auto-merge (squash)
November 11, 2026 20:28
transfix
added a commit
that referenced
this pull request
Nov 12, 2026
Only job_intrinsics_test.cpp conflicted. Master's #1150 fixed the same pre-#1137 calls this branch fixed in 600c144, but kept a ProviderGuard that clears the app's providers on the way out; this takes master's version, so the file matches master. The rest merged cleanly: #1151's spawn points (world_spawns.cpp, the world rules' spawns, the loader and scene-world tests), #1145's macOS libcurl with WebSockets (CMake and a ci.yml configure assertion), #1148's wasmtime in the arix and ariglx recipes, and #1149's ocean band. None of them registers an action-intrinsic provider, and none adds writable process-wide state: their only new statics are vehicle_view.cpp's constant colour tables.
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.
O7b in
docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md(B2, B6): this measures how far the sea physics feels is from the sea lsystem_coast draws, and chooses the band size M against that residual. It also fixes two OceanFFT bugs the harness found, and halves the residual by fixing how the shader samples.cvcgl_ocean_band, the residual harnesslsystem_coast's three cascades (the 251, 83 and 29 m tiles, the default 9 m/s wind sea) run on the GPU in OceanFFT at 256² and are read back.
cvc::ocean::sea_surface(#1142) evaluates the same h0 on the CPU, and the harness compares the two three ways:sea_surface::heightgives physics.The harness prints the table the roadmap records. It fails if:
It skips without float render targets, as
cvcgl_ocean_fftdoes.Two OceanFFT bugs it found first
ScopedglEnableDisableinstep()andselfTest()).cvcgl_ocean_fftnever saw this, because it runs N = 64 in a 64-pixel window.The residual
On the GPU's lattice (height, RMS of GPU − CPU over the RMS height):
The drawn sum, over 211² points of the 251 m tile:
oDispnow takes the texel nearest the point, half a texel over, and the shore check samples the same way.--shore-checkstill finds no vertex on dry ground, and the frames look as before.band_paramsdefault and the roadmap's first estimate.No pin changes: the tests pin their bands explicitly.
Checked locally (Windows Release, GL build)
cvcgl_ocean_bandpasses (7 checks) andcvcgl_ocean_fftpasses.ocean_sea_test16 andphysics_field_test21 pass.lsystem_coast --shore-checkfinds 0 vertices on dry ground, and an offscreen frame renders as before.git clang-formatis clean.Next
O7c: crates and barrels in lsystem_coast that ride the swell, are carried by the breakers and the swash, and settle on calm lake water.