Volumes and Cross-Sections
What it is
A volume is a shape that changes where water exists:
| Mode | Effect |
|---|---|
| Exclude | No water inside (boat interiors, caves, a dry room) |
| Include | Water only inside (a pool or tank cut from an ocean body) |
| Damping | Calm waves inside |
| None | Inactive |
Shapes: TidalVolumeAnalytic (Cube, Sphere, Cylinder - size is the transform’s scale) and
TidalVolumeSDF (any mesh, baked to a 3D signed-distance texture). Clip Visual decides what
a cut looks like: Clip Only, Cross Section (shows the water column with fog on the cut
face, like an aquarium wall), or Show Water Under.
Perspective camera required for cut-aways: In v2.2, orthographic cameras and Scene view Iso mode show the water surface, but not bounded-body sides or volume cross-sections. Switch to Perspective to view the water through a cut face.
How to add it
GameObject > Tidal 2 > Volume > Cube / Sphere / Cylinder / SDF (Mesh). Scale it to the area,
pick the Mode. For SDF, assign a Source Renderer (with a MeshFilter) and bake.
In the editor
Screenshot: Tidal Volume Analytic with the banner. Volume - Mode Exclude, Clip Visual Clip Only, Feather 0.02. Shape - Analytic Type Cube. Affects - Layers Water, Only These Bodies (0).
Screenshot: Tidal Volume SDF on the Island demo’s pirate sloop. Volume - Mode Exclude,
Clip Visual Clip Only, Feather 0.001. Shape - Source Renderer WaterMask_Proxy (a simple
hull mesh), SDF CorsairSloop_HullSDF, Resolution 1, a Regenerate SDF button and the bake
size “44x40x128 0.43 MB (212 tris)”. Affects - Layers Water, Only These Bodies (0).
Preview - Show In Scene (on), Scale/Offset fields, view buttons Volume | Slice | SDF, and
a 3D preview of the baked hull shape coloured by distance (orange at the top edge through green
to blue), with “44 x 40 x 128 RHalf - drag to orbit, scroll to zoom”.
Show In Scene draws the baked shape on the object in the Scene view as a red-tinted gizmo:
Screenshot (Scene view, Demo_Island): the pirate sloop playerShip selected, sitting in a
shallow lagoon beside a sandy island with a wooden jetty. Its hull is tinted red/orange - the
TidalVolumeSDF gizmo showing the baked hull shape that keeps water out of the boat - inside a
cyan wire box (the volume’s bounds). Thin wire ellipses around the hull are the wake emitter
gizmos, and a small yellow sphere marks a float point.
Screenshot: the Scene view: a selected cube volume drawn as a cyan wire box sitting on the ocean; inside it the water surface is cut away, leaving a flat brown-shaded square where the water was removed.
Screenshot (Game view, Demo_ManyBodies): a side-on view of a bounded body of turquoise water seen through its cut face: the wavy surface line runs across the upper part of the image with sky above and clear teal water below, like looking into an aquarium.
Screenshot (Game view, Demo_IndoorPool): an orange tiled floor in a grid-walled hall with three rectangular pools cut into it; each pool holds green glowing water lit by an underwater light. Each pool is its own bounded body.
Settings
| Field | Meaning |
|---|---|
| Mode | Exclude / Include / Damping / None |
| Clip Visual | Clip Only, Cross Section, Show Water Under |
| Feather | Clip edge softness (m), default 0.02 |
| Damping | Damping mode: 1 = untouched, lower = calmer |
| Only These Bodies | Non-empty = exclusive scope |
Floating objects should list their own hull volume in TidalBuoyancy.IgnoreVolumes.
Scripting
var vol = hull.AddComponent<TidalVolumeAnalytic>();
vol.AnalyticType = TidalVolumeAnalyticTypes.Cube;
vol.Flags = TidalVolumeFlags.EXCLUDE; // INCLUDE, DAMPEN, NONE
vol.ClipVisual = TidalClipVisuals.CROSS_SECTION;
vol.AffectedBodies = new List<TidalWaterBody> { body };
bool hits = vol.Affects(body);
Common issues
| Symptom | Cause | Fix |
|---|---|---|
| Boat floats on its own interior | Volume seen by buoyancy | Add to Ignore Volumes |
| Water still inside the hull | Volume too small / wrong Mode | Enclose fully; Mode Exclude |
| SDF volume does nothing | Not baked | Assign Source Renderer and bake |
| Hard jagged cut edge | Feather 0 | Raise Feather slightly |
| Affects another body | Scope empty | Fill Only These Bodies |