# wysl-2/worldmeshes architecture

> Architecture diagram of the GitHub repository wysl-2/worldmeshes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wysl-2/worldmeshes
- Repository: https://github.com/wysl-2/worldmeshes
- Video tour (about a minute): https://gitdiagram.com/wysl-2/worldmeshes/video

## Overview

WorldMeshes is a Unity terrain-authoring editor with runtime terrain generation and clipmap presentation. The main workflow is to edit terrain modifiers, inspect staged previews and analysis visualizations, then run a runtime bake that plans and generates terrain outputs, packages Addressables, and synchronizes the scene. Stamps and regional elevation are distinct authoring capabilities. The sampled excerpts support preview residency/composition and bake orchestration; some feature wiring is inferred only at subsystem level from the tree, so uncertain calls are omitted.

Main entry points: [`Editor/RuntimeBake/Pipeline/TerrainRuntimeBakePipeline.cs`](https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Pipeline/TerrainRuntimeBakePipeline.cs) (Bake Pipeline), [`Editor/Window/Core/WorldMeshesEditorWindow.cs`](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Window/Core/WorldMeshesEditorWindow.cs) (WorldMeshes Window), [`Editor/Preview/Scene/TerrainAuthoringSceneViewController.cs`](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Scene/TerrainAuthoringSceneViewController.cs) (Scene Preview Control), [`Editor/Preview/Core/TerrainAuthoringPreviewService.cs`](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Core/TerrainAuthoringPreviewService.cs) (Preview Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Terrain Authoring"]
  node_modifier["Modifier Editing"]
  node_stamps["Stamp Library"]
  node_regional["Regional Elevation"]
end

subgraph group_preview["Preview And Analysis"]
  node_preview_scene["Scene Preview Control"]
  node_preview_service["Preview Service"]
  node_preview_cache["Preview Cache"]
  node_compositor["Height Compositor"]
  node_visualization["Terrain Analysis Views"]
end

subgraph group_bake["Runtime Bake"]
  node_planner["Bake Planner"]
  node_pipeline["Bake Pipeline"]
  node_height["Height Generation"]
  node_streaming["Height Streaming"]
  node_surface["Surface Masks"]
  node_collision["Collision Meshes"]
  node_addressables["Addressables Packaging"]
  node_scene_sync["Scene Synchronization"]
end

subgraph group_runtime["Runtime Terrain"]
  node_clipmap["Clipmap Controller"]
end

subgraph group_editor["Editor Interface"]
  node_window["WorldMeshes Window"]
end

node_artist(("Terrain Artist"))

node_artist -->|"authors in"| node_window
node_window -->|"edits modifiers"| node_modifier
node_window -->|"manages stamps"| node_stamps
node_window -->|"edits elevations"| node_regional
node_window -->|"views terrain"| node_preview_scene
node_preview_scene -->|"requests residency"| node_preview_service
node_preview_service -->|"stages cache"| node_preview_cache
node_preview_service -->|"composes tiles"| node_compositor
node_preview_scene -->|"selects display"| node_visualization
node_window -->|"starts bake"| node_pipeline
node_pipeline -->|"plans stages"| node_planner
node_pipeline -->|"compiles height"| node_height
node_pipeline -->|"compiles streaming"| node_streaming
node_pipeline -->|"generates masks"| node_surface
node_pipeline -->|"generates collision"| node_collision
node_pipeline -->|"packages assets"| node_addressables
node_pipeline -->|"synchronizes scene"| node_scene_sync
node_scene_sync -->|"configures scene"| node_clipmap

click node_window "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Window/Core/WorldMeshesEditorWindow.cs"
click node_modifier "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/Modifiers/TerrainAuthoringModifierService.cs"
click node_stamps "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/Stamps/TerrainHeightStampLibraryUtility.cs"
click node_regional "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/RegionalElevation/TerrainRegionalElevationService.cs"
click node_preview_scene "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Scene/TerrainAuthoringSceneViewController.cs"
click node_preview_service "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Core/TerrainAuthoringPreviewService.cs"
click node_preview_cache "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Core/TerrainAuthoringPreviewCache.cs"
click node_compositor "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Composition/TerrainHeightCompositor.cs"
click node_visualization "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Visualization/TerrainAuthoringVisualizationController.cs"
click node_planner "https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Planning/TerrainRuntimeBakePlanner.cs"
click node_pipeline "https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Pipeline/TerrainRuntimeBakePipeline.cs"
click node_height "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Height/TerrainRuntimeHeightCompiler.cs"
click node_streaming "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Height/TerrainRuntimeHeightStreamingCompiler.cs"
click node_surface "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Surface/TerrainSurfaceMaskCompiler.cs"
click node_collision "https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Collision/TerrainCollisionMeshGenerator.cs"
click node_addressables "https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Addressables/TerrainRuntimeAddressablesUtility.cs"
click node_scene_sync "https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Scene/TerrainRuntimeSceneSynchronizer.cs"
click node_clipmap "https://github.com/wysl-2/worldmeshes/blob/main/Runtime/Clipmap/TerrainClipmapController.cs"

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_modifier,node_stamps,node_regional toneBlue
class node_preview_scene,node_preview_service,node_preview_cache,node_compositor,node_visualization toneAmber
class node_planner,node_pipeline,node_height,node_streaming,node_surface,node_collision,node_addressables,node_scene_sync toneMint
class node_clipmap toneRose
class node_window,node_artist toneIndigo
```

## Components

### Terrain Authoring

- [Modifier Editing](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/Modifiers/TerrainAuthoringModifierService.cs): `Editor/Authoring/Modifiers/TerrainAuthoringModifierService.cs`
- [Stamp Library](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/Stamps/TerrainHeightStampLibraryUtility.cs): `Editor/Authoring/Stamps/TerrainHeightStampLibraryUtility.cs`
- [Regional Elevation](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Authoring/RegionalElevation/TerrainRegionalElevationService.cs): `Editor/Authoring/RegionalElevation/TerrainRegionalElevationService.cs`

### Preview And Analysis

- [Scene Preview Control](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Scene/TerrainAuthoringSceneViewController.cs): `Editor/Preview/Scene/TerrainAuthoringSceneViewController.cs`
- [Preview Service](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Core/TerrainAuthoringPreviewService.cs): `Editor/Preview/Core/TerrainAuthoringPreviewService.cs`
- [Preview Cache](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Core/TerrainAuthoringPreviewCache.cs): `Editor/Preview/Core/TerrainAuthoringPreviewCache.cs`
- [Height Compositor](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Preview/Composition/TerrainHeightCompositor.cs): `Editor/Preview/Composition/TerrainHeightCompositor.cs`
- [Terrain Analysis Views](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Visualization/TerrainAuthoringVisualizationController.cs): `Editor/Visualization/TerrainAuthoringVisualizationController.cs`

### Runtime Bake

- [Bake Planner](https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Planning/TerrainRuntimeBakePlanner.cs): `Editor/RuntimeBake/Planning/TerrainRuntimeBakePlanner.cs`
- [Bake Pipeline](https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Pipeline/TerrainRuntimeBakePipeline.cs): `Editor/RuntimeBake/Pipeline/TerrainRuntimeBakePipeline.cs`
- [Height Generation](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Height/TerrainRuntimeHeightCompiler.cs): `Editor/Generation/Height/TerrainRuntimeHeightCompiler.cs`
- [Height Streaming](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Height/TerrainRuntimeHeightStreamingCompiler.cs): `Editor/Generation/Height/TerrainRuntimeHeightStreamingCompiler.cs`
- [Surface Masks](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Surface/TerrainSurfaceMaskCompiler.cs): `Editor/Generation/Surface/TerrainSurfaceMaskCompiler.cs`
- [Collision Meshes](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Generation/Collision/TerrainCollisionMeshGenerator.cs): `Editor/Generation/Collision/TerrainCollisionMeshGenerator.cs`
- [Addressables Packaging](https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Addressables/TerrainRuntimeAddressablesUtility.cs): `Editor/RuntimeBake/Addressables/TerrainRuntimeAddressablesUtility.cs`
- [Scene Synchronization](https://github.com/wysl-2/worldmeshes/blob/main/Editor/RuntimeBake/Scene/TerrainRuntimeSceneSynchronizer.cs): `Editor/RuntimeBake/Scene/TerrainRuntimeSceneSynchronizer.cs`

### Runtime Terrain

- [Clipmap Controller](https://github.com/wysl-2/worldmeshes/blob/main/Runtime/Clipmap/TerrainClipmapController.cs): `Runtime/Clipmap/TerrainClipmapController.cs`

### Editor Interface

- [WorldMeshes Window](https://github.com/wysl-2/worldmeshes/blob/main/Editor/Window/Core/WorldMeshesEditorWindow.cs): `Editor/Window/Core/WorldMeshesEditorWindow.cs`

### Other components

- **Terrain Artist**

## Connections

- Terrain Artist → WorldMeshes Window: authors in
- WorldMeshes Window → Modifier Editing: edits modifiers
- WorldMeshes Window → Stamp Library: manages stamps
- WorldMeshes Window → Regional Elevation: edits elevations
- WorldMeshes Window → Scene Preview Control: views terrain
- Scene Preview Control → Preview Service: requests residency
- Preview Service → Preview Cache: stages cache
- Preview Service → Height Compositor: composes tiles
- Scene Preview Control → Terrain Analysis Views: selects display
- WorldMeshes Window → Bake Pipeline: starts bake
- Bake Pipeline → Bake Planner: plans stages
- Bake Pipeline → Height Generation: compiles height
- Bake Pipeline → Height Streaming: compiles streaming
- Bake Pipeline → Surface Masks: generates masks
- Bake Pipeline → Collision Meshes: generates collision
- Bake Pipeline → Addressables Packaging: packages assets
- Bake Pipeline → Scene Synchronization: synchronizes scene
- Scene Synchronization → Clipmap Controller: configures scene
