Skip to content
mistificatorPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

Deep Dive — Procedural Underwater World Tech Demo

Deep Dive is a real-time, 100% procedural 3D underwater and ocean-surface exploration tech demo built with C++20, Qt 6, and OpenGL 3.3 / 4.0 Core. Every element in the scene — volcanic bathymetry, rock normal/height textures, coral ecosystems, skeletal shipwrecks, treasure chests, marine and coastal fauna, anatomically rigged scuba divers, a research bathyscaphe, dual-medium ocean optics, vector app icons, a reactive stereo soundscape, and seed-driven generative ambient music — is synthesized mathematically on the fly with zero external 3D models, texture assets, or audio files.


image image image image image ---

What You Will See

  • Closed 1.6 × 1.6 km Volcanic Caldera: A sprawling, fully enclosed ocean basin (1600 × 1600 m) surrounded by organic fjord-like perimeter cliffs rising well above the ocean surface (y = +28 m), preventing the player from ever swimming into an empty void.
  • Dramatic Bathymetry & Landmarks:
    • Intersecting winding canyons, tectonic shelf drops, layered geological terraces, and Voronoi-carved rock crevices.
    • 22 central rocky spires and sea stacks — some submerged reefs, others piercing the ocean surface with wet rock bands, windswept coastal cliff grass, animated shoreline foam, swirling lace, reflected ripples, and rising micro-bubbles.
    • 5 deep abyssal pits plunging down to ~-70 m, where surface light and caustics fade into near-total darkness.
  • Playable Modes & Third-Person Avatars (6 Modes, 4 Camera Views):
    • Switch seamlessly (C / L3) between 1st Person, Reef Fish, Manta Ray, a yellow Research Bathyscaphe (with a reversing propeller and toggleable twin headlights via H), and two 100% procedural Scuba Divers (Male & Female) with a 54-bone articulated skeleton, wetsuit accents, fins, tanks, BCD, flexible regulator hose, animated fingers, head look-at tracking, and synchronized exhaled bubble streams.
    • Cycle 4 smooth orbital camera viewpoints (Y) in any third-person mode: Rear → Front → Side → Far Rear, with spring-arm obstacle avoidance.
  • Water-Surface Breaching, Ballistics & Cinematic Bullet-Time:
    • Ascend rapidly through the ocean surface while holding Shift to launch out of the water along a ballistic arc under gravity (19.5 m/s²) with automatic Bullet-Time (0.26× slow-motion at the apex), 3D airborne spray particles, screen-space splashes, and dripping water droplets on the camera lens.
    • Above the waterline, the scene opens into a sunlit noon sky with drifting procedural cumulus clouds, atmospheric haze, two-sided ocean reflections, and crisp surf acoustics.
  • Diverse Multi-Layered Flora:
    • Swaying giant kelp forests with bioluminescent specks, seagrass meadows, bushy Sargassum, staghorn and table corals, gorgonian sea fans, tube sponge colonies, animated sea anemones, sunlit plateau moss & rosettes, bioluminescent abyssal sea pens, and wind-blown coastal grass on emergent rock ledges.
  • 14 Procedural Shipwrecks (5 Archetypes) & Sunken Treasure:
    • Galleons, sleek brigs, split-in-half hulls with swim-through gaps, listing caravels, and merchant nefs built from curved ribs, keels, deck beams, rudders, masts, and breached planking.
    • Open and shattered wooden treasure chests with metallic fittings and spilled gold coins resting around wreck sites.
  • Autonomous Underwater & Coastal Ecosystem:
    • 672 schooling reef fish (28 schools) swirling around reefs, steering around obstacles, and parting naturally when approached.
    • 26 gliding manta rays cruising mid-to-upper water layers with sinusoidal wing deformation and mutual collision avoidance.
    • An autonomous 28-meter humpback whale navigating high open water around spires, periodically surfacing with spray plumes and singing across the caldera.
    • 5 deep-sea anglerfish guarding the abyssal pits, whose swaying bioluminescent lures act as real dynamic point lights; approaching within ~60 m triggers an ambush stance at 10–14 m.
    • Soaring seagulls wheeling high above the caldera cliffs with alternating flap-and-glide cycles, and coastal crabs scuttling across emergent and shallow rocky shelves.
  • 4 Switchable Biomes & Adaptive Underwater Soundtrack: Tropical Reef (Vibrant) (default), Kelp Reef (Emerald), Purple Grotto, and Abyssal Trench — paired with a seed-specific 10-minute generative ambient score with deep sub-bass that morphs smoothly across biomes, fades away cleanly above the waterline, and can be toggled at any time (M).
  • Pause Menu, Photo Mode & Live Telemetry HUD:
    • Esc (or Start on gamepad, or losing window focus) opens the Pause Menu, freezing simulation and smoothly fading audio out, with Resume, Photo Mode, an interactive visual Controls diagram, and Exit.
    • Photo Mode keeps the world frozen while letting you fly the camera freely and capture clean PNG screenshots (F12 → Pictures/DeepDive/).
    • Toggleable Telemetry HUD (`) displays GPU/OpenGL version, MSAA, Tessellation, Shadows, PostFX, Audio volume & Music state, Gamepad status, FPS, chunk/LOD distribution, rendered triangles, visible fauna counts, active camera/avatar/headlight state, depth/altitude, bullet-time/collision flags, seed, and biome.

Controls

Keyboard shortcuts are resolved by physical hardware scan codes on Windows (PS/2 Set 1), Linux (X11/Wayland evdev), and macOS (ANSI keycodes), so movement and hotkeys work identically regardless of the active OS keyboard layout (Cyrillic, Greek, AZERTY, CJK, etc.).

Keyboard & Mouse

Camera look is free-look by default whenever the window is active in Playing or Photo Mode.

Input Action
Mouse Move Free-look camera
W / A / S / D Swim forward / strafe left / swim backward (reverse stroke / reverse propeller) / strafe right
Space / Ctrl Ascend / Descend vertically
Shift High-speed sprint (hold while ascending through the surface to breach + trigger Bullet-Time)
C Cycle 3rd-person view / avatar (1st Person → Fish → Manta → Bathyscaphe → Diver M → Diver F)
Y Cycle 3rd-person camera position (Rear → Front → Side → Far Rear)
H Toggle Bathyscaphe twin headlights
` / ~ / ё Toggle HUD telemetry overlay (hides hint bar in Photo Mode)
B Cycle biome palette (4 biomes — also morphs music harmony & arrangement)
R Regenerate world with a new seed (crossfades smoothly into a new musical theme)
L Toggle soft directional shadows
P Toggle Post-Processing pipeline (Bloom, God Rays, lens optics, ACES, vignette)
F Toggle wireframe mode (inspect terrain, prop & tessellation LOD)
T Toggle OpenGL 4.0 hardware tessellation (when supported by GPU)
K Summon the humpback whale nearby and trigger a whale call
M Toggle ambient music on / off (on by default; off restores the classic bioluminescent pad while keeping all sound effects active)
+ (=) / - Increase / decrease master audio volume
Alt + Enter Toggle fullscreen / windowed mode
F12 Save PNG screenshot (Photo Mode)
Esc Open / close Pause Menu (exits Photo Mode back to Pause Menu; also pauses automatically on focus loss)

In the Pause Menu: W/S or ↑/↓ navigate items, A/D, ←/→, or Tab switch Controls diagram tabs, Enter/Space confirms, and Esc goes back / resumes.

Gamepad (XInput & USB HID Fallback)

Supports XInput controllers (Xbox, 8BitDo, Steam Input, etc.) with haptic rumble on collisions, surface breach/splashdown, and whale summons, plus a Windows Multimedia (WinMM) fallback for generic USB/DirectInput controllers.

Control Playing Mode Pause Menu / Photo Mode
Left Stick Swim forward / backward / strafe (radial deadzone) Navigate menu (Pause) / Move camera (Photo)
Right Stick Look around (non-linear response curve) Look around (Photo)
RT / A (Cross) Ascend vertically Confirm selection (Pause) / Save screenshot (Photo)
LT / B (Circle) Descend vertically Back / Resume (Pause) / Return to menu (Photo)
RB (R1) Sprint Next Controls tab (Pause) / Fast camera (Photo)
LB (L1) Summon humpback whale (+ haptic rumble) Previous Controls tab (Pause)
L3 (Left Stick Click) Cycle 3rd-person view / avatar (C) —
R3 (Right Stick Click) Toggle wireframe mode (F) —
Y (Triangle) Cycle biome palette —
X (Square) Toggle Post-Processing pipeline —
Back / View (Share) Toggle HUD overlay Toggle hint bar (Photo)
Start / Menu (Options) Open Pause Menu Resume (Pause) / Return to menu (Photo)
D-Pad Left / Right Toggle shadows / Toggle ambient music (M) Switch tabs (Pause)
D-Pad Up / Down Master audio volume + / - Navigate menu (Pause)

Mathematical & Algorithmic Techniques

1. Procedural Terrain, Architecture & Texture Synthesis

  • Value Noise & Fractional Brownian Motion (fBm): Multi-octave 3D lattice Value noise blended with Smoothstep interpolation and inter-octave domain rotations builds macro-scale seafloor undulations and organic caldera boundaries (Fractional Brownian motion).
  • Domain Warping & Ridged Multifractals: Low-frequency fBm offsets feed back into sampling coordinates to carve twisting canyon channels and coastal fjords. Inverted absolute noise octaves (1 - |n|, squared and weighted) create sharp ridges, crags, and faceted central spires.
  • Voronoi / Worley Cellular Noise: Distance-to-edge metrics ($F_2 - F_1$) generate sharp tectonic fissures in the terrain and fracture lines in the procedural 1024×1024 tileable rock height/normal map (Worley noise, Voronoi diagram).
  • Geological Terracing & Padded Central-Difference Normals: Elevation values are partially quantized via smoothstep stair functions to form natural rock ledges. Each chunk evaluates a padded 51 × 51 local height cache for its 48 × 48 grid and computes normals via central Finite differences, avoiding seam discontinuities while accelerating world generation across std::thread workers.
  • Parametric Shipwreck Lofting: Hull silhouettes are generated analytically from longitudinal beam curves (ogival bow tapering + transom stern narrowing), sheer lines, and curved cross-sectional ribs with sailing-ship tumblehome. Deterministic hashing removes planks and upper rib segments in localized breach zones to expose the internal wooden skeleton.
  • CPU/GPU Synchronized Ocean Waves: The 4-harmonic directional wave equation in ProcMath::sampleWaterWaveHeight(x, z, t) (Noise.h) is mirrored identically in the water vertex and tessellation evaluation shaders so breaching, splashdown, and camera waterline transitions match the visible wave crests exactly.

2. Procedural Human Anatomy, 54-Bone Rigging & Animation

  • Anatomically Dimorphic Parametric Lofting (HumanMeshGenerator + DiverMeshGenerator): Both Male and Female scuba divers are sculpted purely mathematically from parametric cross-sectional ellipses/superellipses and smooth joint blends — encoding skeletal and silhouette dimorphism (height, shoulder breadth, torso taper, waist/hip curves, leg spacing, and anatomical wetsuit paneling) with zero external meshes.
  • 54-Bone Hierarchical Skeleton & GPU Linear-Blend Skinning: A unified 54-bone rig (uBones[64] in ShadersDiver.h) covers the spine & head (6 bones), arms (8 bones), 5 articulated 3-phalanx fingers per hand (30 bones), and legs + flexible 2-segment fin blades (10 bones). Smoothstep analytical skin weights eliminate joint pinching, while rigid scuba tanks stay locked to the Chest bone and the flexible regulator hose interpolates smoothly between Chest and Head.
  • Procedural Swimming Kinematics (DiverAnimator): Computes phase-lagged travelling-wave fin kicks (Thigh → Shin → Foot → FinMid → FinTip), forward/reverse arm strokes (including active back-paddle when pressing S), trailing finger curl waves, body pitch/bank alignment with velocity, and anatomically clamped Neck + Head look-at tracking toward nearby whales, shipwrecks, and anglerfish.

3. Chunked Multi-Tier LOD, Hardware Tessellation & Frustum Culling

  • 4-Level Terrain LOD with Anti-Crack Skirts: The 1600 × 1600 m caldera is divided into 20 × 20 = 400 chunks (80 × 80 m each, 48 × 48 cells at LOD0 $\Rightarrow$ 1.67 m vertex spacing). All terrain vertices reside in a single VBO, drawn with 4 shared LOD index buffers (strides 1, 2, 4, 8) via glDrawElementsBaseVertex and 14 m downward skirts to seal LOD borders (Level of detail).
  • Optional OpenGL 4.0 Adaptive Hardware Tessellation (T): When an OpenGL 4.0+ context is available, GL_PATCHES shaders dynamically subdivide near-field geometry:
    • Terrain (EnvTess*, factor 1..6): Edge-midpoint distance scaling fading smoothly to 1.0 before the LOD0→LOD1 boundary, with triplanar 3D displacement sampled from uRockTex.a.
    • Boulders, Corals & Fauna (InstPropTess*, FaunaTess*, factor 1..5): Phong silhouette smoothing guarded by a per-edge creaseGuard (depending only on each edge's two vertices and normals) to prevent cracking on sharp rock creases and fish snouts.
    • Ocean Surface (WaterTess*, factor 1..6): Subdivides the polar wave mesh and injects fine near-field capillary ripples directly in the Tessellation Evaluation Shader.
  • Discrete Prop & Fauna LOD + Hysteresis: Boulders, kelp, flora, and fauna use 2-level discrete LODs with a Hysteresis deadband ($\pm 6\text{–}12\text{ m}$) to eliminate transition popping.
  • Gribb–Hartmann Frustum Culling: Six normalized clip planes extracted from the View-Projection matrix cull chunks and fauna independently for both the main pass and the shadow map pass (Viewing frustum).

4. Collision Detection, Ballistics & Autonomous AI Steering

  • Uniform Spatial Grid ($O(1)$ Broad-Phase): Static boulder SphereColliders and shipwreck / rock-ledge OBBColliders are binned into a 20 × 20 spatial grid matching the world chunks (Bounding volume).
  • Multi-Sphere Avatar Collisions & Sphere-vs-OBB Sliding: Divers, the bathyscaphe, and the manta avatar use multi-sphere collision hulls tested against analytical heightfields, lateral cliff probes, boulder spheres, and Oriented Bounding Boxes (exact closest point in local orthonormal box space), preventing heads, tanks, or hulls from clipping into rock ledges or wrecks. Mutual fauna-vs-player and fauna-vs-fauna resolution keeps schools, mantas, and the whale physically separated (Collision detection).
  • Decoupled Time-Scaling (realDt vs simDt): During surface breaches, simDt = realDt * timeScale slows ballistic physics, waves, fauna, and shader animations down to 0.26×, while camera rotation, HUD, and lens-effect decay stay responsive at full realDt.
  • Autonomous Steering:
    • Fish & Mantas: Home-orbiting, tangential swirling, player-fleeing (small fish), and forward-probe obstacle avoidance inspired by Boids.
    • Humpback Whale: High-altitude waypoint selection paired with a 5-ray × 3-distance horizontal clearance fan (0°, ±24°, ±52° out to 76 m) checking both spheres and OBB rock ledges, spire keep-out fields, periodic surface-breaching arcs, and rate-limited yaw/pitch/bank smoothing.
    • Abyssal Anglerfish, Seagulls & Crabs: Anglerfish patrol pit floors and pivot into a 10–14 m ambush standoff when approached within 60 m; seagulls circle emergent spires with banked turns; crabs patrol valid shallow/emergent shelves while avoiding OBB rock slabs and wrecks.

5. Rendering, Dual-Medium Optics & Volumetric Shaders

  • GPU Hardware Instancing & Vertex-Shader Animation: Fish, mantas, anglerfish, the whale, seagulls, crabs, kelp, and props are batched with glDrawElementsInstanced. Spine waves, wing flaps, crab leg scuttling, kelp currents, coastal grass wind, and lure sway run entirely on the GPU (Geometry instancing).
  • Derivative-Corrected Triplanar Mapping & Slope-Aware Caustics: Terrain uses triplanar Normal mapping with hardware Mipmapping and up to 16× Anisotropic filtering. True face normals (dFdx(vWorldPos) × dFdy(vWorldPos)) prevent texture stretching and vertical caustic streaks on cliffs. Animated Caustics attenuate smoothly with slope, depth, and shadows, and disable automatically above the waterline.
  • Texel-Snapped Soft Shadows (16-Tap Vogel Disk): The 2048 × 2048 orthographic shadow frustum snaps to world-space texel increments (Shadow mapping). Shading combines a 4-tap blocker search with 16-tap Percentage-closer filtering rotated per fragment along a Golden angle Vogel spiral.
  • True Volumetric God Rays (Analytical Ray-Marched Cones): Light shafts are rendered as GPU-instanced closed 3D truncated cones with GL_CULL_FACE (GL_FRONT) and depth testing disabled so every covered pixel executes once — even when swimming inside a beam. The fragment shader computes the exact ray-cone interval $[t_0, t_1]$, clips it against the pre-pass scene depth texture (m_sceneDepthTex) for soft terrain intersections, integrates radial density $(1 - r^2)^2$, modulates animated caustic filaments from uRockTex, and samples uShadowMap so cliffs, wrecks, and the whale carve volumetric shadows through the beams.
  • Two-Sided 3D Ocean Surface: A camera-centered polar wave mesh (72 non-linear rings × 96 sectors) adapts to camera elevation:
    • From below: Snell's law ($\eta = 1.3333$) and dielectric Fresnel equations render Snell's window ($48.6^\circ$ critical angle) surrounded by Total internal reflection and depth-reconstructed shoreline foam.
    • From above: Dielectric Fresnel ($F_0 = 0.02$), daytime sky & cloud reflection, sparkling sun glitter across crests, shallow turquoise water refraction via uSceneDepthTex, subsurface wave-crest glow, and surf/whale foam trails.
  • Beer–Lambert Spectral Attenuation & Dynamic Lights: Underwater fog applies wavelength-dependent transmittance $\mathbf{T}(d) = \exp(-d \cdot \sigma \cdot [1.85, 1.06, 0.86])$ (Beer–Lambert law), transitioning to crisp daytime aerial perspective above water. Up to 8 anglerfish lures (uLurePos[8]) and the Bathyscaphe's twin spotlight cones act as real-time dynamic lights across environment, fauna, and diver shaders.
  • HDR Post-Processing Pipeline: Renders into an 8× MSAA RGBA16F HDR FBO, resolves color and depth, runs separable Gaussian blur for Bloom, composites depth turbidity, screen-space god rays, mask-edge Chromatic aberration, waterline splash/foam overlays, dripping lens droplets above water, subtle bullet-time framing, vignetting, and ACES filmic Tone mapping.

Procedural Audio & Generative Music Synthesis

All sound and music are generated in real time by UnderwaterAudioEngine / UnderwaterSynthDevice (src/UnderwaterAudio.h, src/UnderwaterAudio.cpp) and AmbientMusicSynth (src/AmbientMusicSynth.h, src/AmbientMusicSynth.cpp) as a continuous stereo PCM stream (Procedural audio).

Engine Architecture, Cross-Platform PCM & Hot-Swap Devices

  • Sample-Rate-Independent Lock-Free DSP: The render thread publishes depth, swim speed, biome, world seed, above-water state, bullet-time scale, diver breathing phase, volume, pause/music-mute flags, and whale/splash triggers via std::atomic variables. Inside readData(), all parameter smoothers, Brownian noise integration (with RMS gain compensation), and reverb feedback damping use exponential $1 - e^{-\Delta t / \tau}$ coefficients so timbre and decay stay identical across 44.1, 48, 96, and 192 kHz devices. Fast 32-bit Xorshift noise and Chamberlin State variable filters (BiquadSVF, with NaN/Inf and denormal guards) run with zero allocations or locks.
  • Safe Multi-Format PCM Output (Float / Int32 / Int16 / UInt8): Output buffers are pre-filled with format-accurate silence (0x00 or 0x80 for UInt8) to keep extra surround/DAC channels quiet, mono devices receive an explicit (L + R) / 2 downmix, and samples are written via std::memcpy for safe alignment on ARM64 and x86_64.
  • Automatic Device Hot-Swap & Recovery: Monitors QMediaDevices::audioOutputsChanged (debounced at 180 ms) and QAudioSink::stateChanged. Plugging in or removing headphones, USB DACs, or Bluetooth headsets (or starting without an audio device) seamlessly reconfigures both sound effects and music reverb with a 180 ms click-free fade-in and exponential retry backoff — while leaving unaffected streams uninterrupted.
  • Smooth S-Curve Envelopes: Hermite smoothstep ramps eliminate clicks on startup (0.75 s), pause/resume (0.28 s / 0.42 s), music toggle (0.55 s), water-surface music fade-out/fade-in (0.55 s / 0.85 s), and device hot-swap (0.18 s); DSP freezes cleanly once pause fade-out reaches zero.

Generative Underwater Ambient Music & Variability (AmbientMusicSynth)

Deep Dive synthesizes a slow-moving, Generative music score on the fly with deep oceanic sub-bass and zero audio samples:

  • Seamless 10-Minute Macro Arc (600 s Loop): Every world's score unfolds from t = 0 across 10 distinct 60-second dramatic sections (150 bars / 300 two-second steps) — opening quietly on breathing sub-bass and emerging pads (Abyssal Awakening), introducing the main and contrasting melodic themes, building toward a harmonic peak around minutes 5–6 (Deepest Heart), floating into a sparse bass-light suspension (Weightless Suspension), and dissolving back onto the home tonic at minute 10 (Stillness & Return) so the 600 s → 0 s wrap is completely seamless.
  • Seed-Deterministic Composition & Smooth World Transitions (R): Each world seed is hashed via SplitMix32 to deterministically derive a unique musical identity — tonic pitch (C2–G2, placing the sub-octave at 32.7–49 Hz), filter warmth, FM harmonic coloration, bass breathing LFO rate (0.09–0.18 Hz), per-section 4-chord progressions from 8 curated modal templates with seed mutations, and two stepwise 8-step melodic motifs (main and contrasting) with contemplative rests. Regenerating the world (R) spawns the new seed's score at t = 0 in a second slot and performs a 3.2 s equal-power Crossfade ($\cos / \sin$) between the old and new themes.
  • Seamless Biome Harmony & Arrangement Morphing (B): Switching biomes continuously reshapes modal scales (Mode), chord voicings, filter brightness, depth darkening, and reverb space (~1.85 s control-rate smoothing) with zero abrupt pitch bends:
    • Tropical / Kelp Reef: Bright Dorian mode, open add9/6th pad voicings, crystalline 2:1 FM bell-like melody, and airy upper shimmer.
    • Purple Grotto: Mystical Aeolian mode, suspended sus4/11th voicings, velvety 3:1 FM melody, and the deepest reverb tail.
    • Abyssal Trench: Dark Phrygian mode, wide dark-fifth voicings, boosted warm-saturated sub-bass, low-passed cavernous tone, and a sparser melody dropped an octave lower (1.5:1 hollow FM).
    • A 4-slot polyphonic pad crossfader (3.4 s per chord slot) and decaying polyphonic melody voices let active chords and notes ring out naturally while new harmonies enter in the target mode.
  • Four-Layer Synth & Dedicated Hadamard FDN Reverb:
    • Deep Synthetic Sub-Bass: Sub-octave sine (clamped $\ge 28\text{ Hz}$), stereo-detuned soft-triangle body, subtle fifth harmonic, resonant SVF low-pass, slow breathing LFO, and soft tanh saturation so its depth remains audible even without a subwoofer.
    • Textural Oceanic Pad: 5-voice stereo-detuned sine/soft-triangle chord ensemble.
    • Slow Evolving Melody & Shimmer: 4 melodic + 2 upper-shimmer FM/sub-octave voices with slow organic envelopes (1.1–3.8 s attack, 5–9.5 s decay) and subtle vibrato.
    • 4-Channel Hadamard FDN Space: Dedicated Feedback delay network with mutually prime delay lines (61.3 / 82.9 / 112.7 / 148.9 ms), orthogonal 4×4 Hadamard matrix diffusion, chorus read modulation, and biome/depth-adaptive high-frequency damping (with minimal sub-bass send to keep low frequencies tight).
  • Dual-Medium Continuity & Classic Fallback (M): The music is heard only underwater, fading out over 0.55 s when surfacing and returning over 0.85 s upon submerging, while its musical timeline keeps advancing silently above water. Music is enabled by default; pressing M (or D-Pad Right) smoothly crossfades (0.55 s) out of the ambient score and restores the original 4-voice biome-reactive bioluminescent pad without muting environmental or fauna sound effects.

Dual-Medium Soundscape Layers

A fast ~35 ms click-free crossfade driven by camera elevation switches smoothly between the underwater and above-water buses:

  1. Hydrostatic Ocean Rumble (Brownian Noise + Depth-Modulated SVF): Stereo Brownian noise filtered through dual SVFs ($Q = 0.65$) whose cutoff drops from ~160 Hz near the surface to a 65 Hz sub-bass rumble in the depths under asynchronous stereo LFOs.
  2. Hydrodynamic Swim Whoosh: Velocity-mapped stereo SVFs (160–480 Hz, 70% band-pass + 30% low-pass) simulating water rushing past the diver.
  3. Synchronized Scuba Regulator Breathing: Active in Diver modes underwater and phase-locked to DiverAnimator::breathPhase() — a soft high-passed second-stage valve inhale (980–1500 Hz) followed by a fluttering low-mid exhaust (240–450 Hz) that triggers real bursts of polyphonic bubbles.
  4. Polyphonic Air Bubbles (20-Voice Minnaert Chirp Pool): Inspired by Minnaert resonance, 20 voices render 2-harmonic exponentially decaying sine bursts (35–90 ms) with upward frequency Chirps and random stereo panning.
  5. Humpback Whale Vocalizations (FM + Additive Synthesis): Autonomous (11–22 s) or triggered (K / LB). Combines 3 procedural pitch contours, 4.8 Hz vibrato, Frequency modulation synthesis, and Additive synthesis (1×, 2.003×, 3.01× partials).
  6. Classic Biome-Reactive Bioluminescent Pad (Music-Off Fallback): 4-voice LFO-modulated additive chord drone tailored to each biome (Reef A2 Asus2, Purple Grotto G2/Dsus4, Abyssal Trench D2 dark fifth), automatically crossfading in when ambient music is toggled off via M.
  7. Canyon Ping-Pong Reverb: Asymmetric cross-coupled Delay (390 ms L, 530 ms R, 0.56 feedback) with sample-rate-invariant low-pass damping modeling high-frequency absorption in water.
  8. Above-Water Surf, Sea Breeze & Seagulls: Two-band wave surf (warm low-mid swell body + high-frequency foam hiss modulated by dual ocean-swell LFOs), speed-reactive sea breeze/flight wind, and a 2-voice multi-syllable seagull synthesizer (4-harmonic formant-filtered calls with natural 58 Hz rasp and descending glides).
  9. Water Breach & Splashdown Synthesizer + tanh Limiter: 2-voice transient bus generating crisp spray cascades + film-break pops on exit and heavy low-end impact thumps + bubble bursts on splashdown, all mastered together with the music bus through a hyperbolic tangent ($\tanh$) soft-clipping Waveshaper.

Graphics & Technology Stack

Layer Technology / Specification
Language & Concurrency C++20 (+ Objective-C++ on macOS), multithreaded world & procedural texture generation (std::thread)
Framework & Windowing Qt 6 (Widgets, OpenGL, OpenGLWidgets, Multimedia), non-blocking stepped startup & native vector icon generator (AppIcon.h / IconGenerator.cpp)
Graphics API & Shaders OpenGL 3.3 Core baseline + automatic OpenGL 4.0 Core hardware tessellation (#version 330 core / #version 400 core)
Framebuffers & Precision 8× MSAA RGBA16F + DEPTH24 main FBO; RGBA16F resolve & half-res ping-pong Bloom FBOs; 2048 × 2048 DEPTH24 shadow map FBO
Procedural Textures 1024×1024 RGBA8 tileable normal/height atlas with mipmaps and up to 16× anisotropic filtering
GPU Discovery & Scoring Win32 DXGI 1.6 (IDXGIFactory6::EnumAdapterByGpuPreference high-performance discrete GPU selection + VRAM ranking) and OpenGL capability queries
Input Layout-independent physical scan-code keyboard; native macOS relative mouse capture (CGAssociateMouseAndMouseCursorPosition + local NSEvent monitor, requiring no Accessibility / Input Monitoring permissions); Win32 XInput (with rumble) + WinMM HID fallback
Audio Backend Qt6::Multimedia (QAudioSink + pull-mode QIODevice, QMediaDevices hot-swap, native CoreAudio/Darwin backend on macOS without FFmpeg)
Packaging & CI/CD CMake + CPack + GitHub Actions: Windows (NSIS multi-user installer + Portable ZIP), Ubuntu (DEB + tar.xz), macOS ARM64 (DragNDrop DMG + Portable ZIP with automated Mach-O, RPATH, TCC, codesign & runtime verification)

Project Structure

├── CMakeLists.txt                     # Build, git semver (MAJOR.MINOR.PATCH.N), Qt deploy & macOS signing
├── .cmake/                            # CPack config, NSIS multi-user hooks, desktop/version templates
├── .github/workflows/build-release.yml# Automated Windows / Ubuntu / macOS builds, bundle checks & releases
├── tools/
│   └── IconGenerator.cpp              # Build-time generator for SVG, ICO, ICNS, PNGs & NSIS banners
└── src/
    ├── main.cpp                       # Entry point, GPU offload hints & OpenGL Core surface setup
    ├── AppIcon.h                      # Procedural vector submarine/porthole icon renderer
    ├── GpuCapabilities.h              # DXGI 1.6 hardware GPU adapter enumeration & VRAM scoring
    ├── Noise.h                        # Value noise, fBm, ridged multifractals, Voronoi, synchronized waves
    ├── WorldGenerator.h               # Shared world, chunk, fauna, collider & mesh structures
    ├── WorldGeneratorEnvironment.cpp  # Caldera heightfield, chunked LOD terrain, collision grid, orchestration
    ├── WorldGeneratorStructures.cpp   # 5 shipwreck archetypes, treasure chests & volumetric god-ray cones
    ├── WorldGeneratorFlora.cpp        # Kelp, seagrass, corals, sponges, anemones, sea pens & cliff grass
    ├── WorldGeneratorFauna.cpp        # Procedural meshes for fish, mantas, whale, anglerfish & seagulls
    ├── WorldGeneratorFaunaWorld.cpp   # Bathyscaphe & coastal crab meshes + fauna/crab agent spawning
    ├── DiverModel.h                   # 54-bone diver skeleton definitions, material IDs & vertex layout
    ├── HumanMeshGenerator.h/.cpp      # Anatomically dimorphic Male/Female parametric human lofting
    ├── DiverMeshGenerator.cpp         # Wetsuits, 5-finger hands, masks, tanks, BCD, flexible hose & fins
    ├── DiverAnimator.h/.cpp           # Procedural swim strokes, finger waves, breathing & head look-at
    ├── ShadersGeometry.h              # Environment, prop, chest & GL 4.0 tessellation shaders (creaseGuard)
    ├── ShadersFauna.h                 # Instanced fauna, bathyscaphe, seagull & crab shaders (+ tessellation)
    ├── ShadersDiver.h                 # 64-bone GPU skinning shaders (shadow & main pass with caustics/lights)
    ├── ShadersAtmosphere.h            # Skybox/clouds, two-sided ocean water, ray-marched god rays, PostFX
    ├── DeepDiveEngine.h/.cpp          # Pure simulation: swimming, breaching, bullet-time, camera & collisions
    ├── DeepDiveEngineFauna.cpp        # Whale clearance navigation, fish/manta/angler/seagull/crab AI
    ├── DeepDiveRender.h/.cpp          # OpenGL 3.3 / 4.0 rendering pipeline, shadows, frustum culling, PostFX
    ├── DeepDiveRenderResources.cpp    # Procedural rock normal/height atlas, shader compilation & GPU buffers
    ├── DeepDiveWidget.h/.cpp          # Qt host widget, stepped async loading, HUD, input & mode state machine
    ├── PauseMenuOverlay.h/.cpp        # Pause menu & interactive Keyboard/Mouse + Gamepad controls diagram
    ├── MacMouseCapture.h/.mm          # Native macOS relative mouse capture (AppKit + CoreGraphics, no TCC)
    ├── GamepadInput.h                 # Zero-dependency XInput + WinMM gamepad & haptic rumble driver
    ├── AmbientMusicSynth.h/.cpp       # Seed-driven 10-min generative ambient music, biome morphing & FDN reverb
    └── UnderwaterAudio.h/.cpp         # Dual-medium lock-free DSP synthesizer with hot-swap device support

Building & Packaging

Requires CMake 3.20+, a C++20 compiler, and Qt 6 (Widgets, OpenGL, OpenGLWidgets, Multimedia). On Windows, dxgi is linked for hardware GPU enumeration (XInput and WinMM are loaded dynamically at runtime). On macOS, AppKit and CoreGraphics are linked automatically for native relative mouse capture.

Quick Build

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
./build/DeepDive

Packaging via CPack

  • Windows (Visual Studio 2022 + NSIS + Portable ZIP):
    cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH="C:/Qt/6.8.3/msvc2022_64"
    cmake --build build --config Release --parallel
    cpack --config build/CPackConfig.cmake -C Release -G "NSIS;ZIP" -B dist
  • Ubuntu / Linux (DEB + tar.xz):
    cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
    cmake --build build --parallel
    cpack --config build/CPackConfig.cmake -G "DEB;TXZ" -B dist
  • macOS (DragNDrop DMG + Portable ZIP):
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0
    cmake --build build --parallel $(sysctl -n hw.ncpu)
    cpack --config build/CPackConfig.cmake -G "DragNDrop;ZIP" -B dist

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages