gz_waves: rendering - Part 3/4#884
Open
caguero wants to merge 6 commits into
Open
Conversation
62909c5 to
f4a163e
Compare
fb9d51b to
a2a41b5
Compare
f4a163e to
4d50173
Compare
a2a41b5 to
3b09c80
Compare
4d50173 to
7df415e
Compare
3b09c80 to
bb957dc
Compare
…ridge Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
…rx_bringup simulation.launch.xml` runs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
…bers HeightMapTexture::Upload now takes the raw column-major WaveField2D buffers + N and transposes to row-major internally (a plain loop, null channels -> zeros), so WaterVisual hands Field()'s pointers straight through with no Eigen::Map. Removes Eigen from the package (it was used only as a transpose helper and wasn't even declared as a dependency) and switches HeightMapTexture members to gz-style this->member. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Agüero <caguero@honurobotics.com>
Extract the column-major -> row-major transpose from HeightMapTexture into a dependency-free GridReflow.hh and cover it with a gtest (the only data transform on the upload path, previously untested because it lived in an anonymous namespace and Upload needs a live Ogre scene). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Agüero <caguero@honurobotics.com>
7df415e to
3a1f9b0
Compare
The analytic Gerstner engine writes the Jacobian determinant into the foam channel, but it barely leaves 1.0, so it carries no usable folding signal — whitecaps are visually indistinguishable from no foam. Gate foamStrength to 0 for the gerstner backend (the FS then skips the foam path entirely), matching the shader's documented intent; FFT/Encino keeps foam. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Agüero <caguero@honurobotics.com>
70b0854 to
69c71f1
Compare
- Fix a data race: hold mutex_ across ResolveVisual so its first-pass material setup (which calls UploadUniforms and reads the cross-thread cache) no longer races PreUpdate on the ECM thread. - Release the per-entity dedup claim in ~Implementation so a reloaded WaterVisual for the same entity can become active again. - Make the one-shot upload log a per-instance member, not a function static. - Tag sim as mutex_-guarded; note the deliberate lock over Update()/Upload(). - Sweep stale 'FFT' naming to 'grid/displacement' (the path is backend- agnostic), refresh foam doc, and explain the Configure const_cast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Agüero <caguero@honurobotics.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.
Third in the stacked series. Adds the renderer, the
WaterVisualGUI system that draws the wave surface, plus a runnable Gerstner-ocean demo world.How to test it?
What this PR adds
WaterVisual(gz-sim-water-visual-system) — a gz-sim GUI system that reads theWavefieldcomponent, rebuilds a thread-private engine from the replicated recipe via the core registry (CreateWaveSimulation), and uploads its height/displacement grid as a GPU heightmap each frame. It is provider-agnostic: it links no wave engine and depends only on thegz_wavescore.HeightMapTexture— the CPU→GPU heightmap helper.Ogre2HeightMapBridge(libwaves-ogre2-bridge) — all Ogre Next access is isolated behind a C-ABI in this separate library, loaded on demand viadlopen, soWaterVisualcarries noDT_NEEDEDonlibgz-rendering-ogre2(which would interfere with gz-rendering's own engine-plugin loader).water_surfacemodel (mesh + shaders + textures) — loadsWaterVisualplus the per-engine GUI registrar(s) in the same<visual>(the only level the GUI's GuiRunner loads systems at). At this point that isgz-sim-waves-gerstner-gui; the FFT registrar line is added by PR4.vrx_gazebo/worlds/open_water.sdf— wired as a Gerstner ocean (gerstner source +model://water_surface,<sea_state>default + advanced-commented block) sovrx_bringup's existing launch runs it directly. Ocean-only: no references outside the PR1–PR3 stack.Provider-agnostic design
The engine registration that lets
WaterVisualrebuild an engine in the GUI process lives in the per-engine GUI plugins (shipped by the provider packages), not in this package. So adding or removing an engine never touchesgz_waves_rendering— it depends only on the core.WaterVisualkeeps a private engine instance (not the component's) because the GUI render thread and the ECM thread both touch it; sharing would race.