# noniv/abyssal-garden architecture

> Architecture diagram of the GitHub repository noniv/abyssal-garden, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noniv/abyssal-garden
- Repository: https://github.com/noniv/abyssal-garden

## Overview

Abyssal Garden is a browser-based, procedurally generated underwater world, rendered with WebGPU and accompanied by synthesized audio. The user opens the page, waits for the scene to build, then dives in to swim using keyboard, mouse, or touch controls; they can also change detail settings and toggle sound. The main generation and rendering path is visible in excerpts, while several presentation and feature details are documented only in the README, so those links cite that documentation.

Main entry points: [`source/src/main.js`](https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js) (Scene Renderer), [`source/src/world.js`](https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js) (World Layout), [`source/template.html`](https://github.com/noniv/abyssal-garden/blob/main/source/template.html) (Scene Page), [`source/src/audio.js`](https://github.com/noniv/abyssal-garden/blob/main/source/src/audio.js) (Soundscape)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser Experience"]
  node_page["Scene Page<br/>[template.html]"]
  node_controls["Camera Controls<br/>[main.js]"]
  node_viewpoints["Viewpoints<br/>[main.js]"]
end

subgraph group_scene["Scene Generation"]
  node_world["World Layout<br/>[world.js]"]
  node_terrain["Terrain Mesh<br/>[world.js]"]
  node_life["World Features<br/>[world.js]"]
  node_geometry["Geometry Helpers<br/>[math.js]"]
end

subgraph group_rendering["Rendering and Quality"]
  node_renderer["Scene Renderer<br/>[main.js]"]
  node_shaders["WGSL Shaders<br/>[shaders.js]"]
  node_quality["Detail Quality<br/>[quality.js]"]
end

subgraph group_sound["Procedural Audio"]
  node_audio["Soundscape<br/>[audio.js]"]
end

node_user(("Diver"))
node_gpu["WebGPU"]

node_user -->|"opens"| node_page
node_page -->|"hosts"| node_renderer
node_user -->|"steers"| node_controls
node_controls -->|"updates camera"| node_renderer
node_viewpoints -->|"sets camera"| node_renderer
node_renderer -->|"builds via makeWorld"| node_world
node_world -->|"builds"| node_terrain
node_world -->|"generates"| node_life
node_world -->|"uses mesh helpers"| node_geometry
node_renderer -->|"requests device"| node_gpu
node_renderer -->|"uses"| node_shaders
node_quality -->|"sets detail"| node_renderer
node_user -->|"enables sound"| node_audio
node_controls -->|"starts sound"| node_audio

click node_page "https://github.com/noniv/abyssal-garden/blob/main/source/template.html"
click node_controls "https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js"
click node_viewpoints "https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js"
click node_world "https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js"
click node_terrain "https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js"
click node_life "https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js"
click node_geometry "https://github.com/noniv/abyssal-garden/blob/main/source/src/math.js"
click node_renderer "https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js"
click node_shaders "https://github.com/noniv/abyssal-garden/blob/main/source/src/shaders.js"
click node_quality "https://github.com/noniv/abyssal-garden/blob/main/source/src/quality.js"
click node_audio "https://github.com/noniv/abyssal-garden/blob/main/source/src/audio.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_page,node_controls,node_viewpoints toneBlue
class node_world,node_terrain,node_life,node_geometry toneAmber
class node_renderer,node_shaders,node_quality toneMint
class node_audio toneRose
class node_user,node_gpu toneIndigo
```

## Components

### Browser Experience

- [Scene Page](https://github.com/noniv/abyssal-garden/blob/main/source/template.html): `source/template.html`
- [Camera Controls](https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js): `source/src/main.js`
- [Viewpoints](https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js): `source/src/main.js`

### Scene Generation

- [World Layout](https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js): `source/src/world.js`
- [Terrain Mesh](https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js): `source/src/world.js`
- [World Features](https://github.com/noniv/abyssal-garden/blob/main/source/src/world.js): `source/src/world.js`
- [Geometry Helpers](https://github.com/noniv/abyssal-garden/blob/main/source/src/math.js): `source/src/math.js`

### Rendering and Quality

- [Scene Renderer](https://github.com/noniv/abyssal-garden/blob/main/source/src/main.js): `source/src/main.js`
- [WGSL Shaders](https://github.com/noniv/abyssal-garden/blob/main/source/src/shaders.js): `source/src/shaders.js`
- [Detail Quality](https://github.com/noniv/abyssal-garden/blob/main/source/src/quality.js): `source/src/quality.js`

### Procedural Audio

- [Soundscape](https://github.com/noniv/abyssal-garden/blob/main/source/src/audio.js): `source/src/audio.js`

### Other components

- **Diver**
- **WebGPU**

## Connections

- Diver → Scene Page: opens (evidence: `README.md`)
- Scene Page → Scene Renderer: hosts (evidence: `README.md`)
- Diver → Camera Controls: steers (evidence: `README.md`)
- Camera Controls → Scene Renderer: updates camera (evidence: `source/src/main.js`)
- Viewpoints → Scene Renderer: sets camera (evidence: `README.md`)
- Scene Renderer → World Layout: builds via makeWorld (evidence: `source/src/main.js`)
- World Layout → Terrain Mesh: builds (evidence: `source/src/world.js`)
- World Layout → World Features: generates (evidence: `source/src/world.js`)
- World Layout → Geometry Helpers: uses mesh helpers (evidence: `source/src/world.js`)
- Scene Renderer → WebGPU: requests device (evidence: `source/src/main.js`)
- Scene Renderer → WGSL Shaders: uses (evidence: `README.md`)
- Detail Quality → Scene Renderer: sets detail (evidence: `README.md`)
- Diver → Soundscape: enables sound (evidence: `README.md`)
- Camera Controls → Soundscape: starts sound (evidence: `source/src/main.js`)
