ThreeStage: A browser-based 3D scene and terrain editor built from scratch on Three.js.
Highlights · Workspaces · Quick Start · Architecture · Attributions
ThreeStage is a self-hosted, web-native 3D scene and terrain editor powered by Three.js, Stimulus, Webpack Encore, and Symfony 8.1. It pairs a familiar desktop-grade dark UI—hierarchical layer management, live transform & material inspectors, bounding-box selection, and viewport camera controls—with a clean modular JSON document format and one-click .zip template packaging.
- Familiar Studio Workflow — Dedicated Layout and Modeling workspaces with a hierarchical layer outliner, custom groups & subgroups, drag-and-drop reordering, visibility & viewport lock toggles (with inheritance), undo/redo (
Ctrl+Z/Ctrl+Y), and real-time property inspectors. - Procedural & Sculpted Terrain — Combine custom heightfields, procedural path and ground textures, instanced scatter systems (grass & stones with per-layer visibility), and non-destructive terrain modifiers such as Gaussian hills.
- Global Asset Browser & Lazy Loading — Browse categorized, searchable
.glb3D assets directly from the Modeling workspace sidebar rail (available in bothEmptyand template scenes) with on-demand loading and shared resource caching. - Modular Scene Templates — Boot into a clean wireframe
Emptystage or load complete multi-asset worlds likeWaldweg(project.json,camera.json,environment.json,terrain.json,objects.json,placements.json, and shared.glbmodels). - Local Snapshots & Dual-Quality ZIP Export — Save work-in-progress instantaneously to browser
localStorageor export either a lightweight Web ZIP (procedural terrain JSONs + only used.webp.glbmodels) or a full-resolution HQ Archive ZIP (uncompressed HQ.glbsources + bakedterrain.glb). - Clean ES6 Class Architecture — Every editor subsystem (viewport, controls, terrain, panels, serialization, and template loading) is implemented as a standalone ES6 class with centralized configuration constants.
| Workspace | Purpose & Tools |
|---|---|
| Layout | Organize the full scene graph (Lights, Landscape, Scatter, Models, and custom user groups), toggle object/instance visibility and 3D viewport locks (inherited by child layers), reorder nodes via drag-and-drop, jump directly to waypoints (#1 - Waypoint), and tune camera projection, fog, sky, exposure, and shadow parameters. |
| Modeling | Place customizable 3D waypoint pins (badge text, rotation/scale, camera billboard) or pick .glb assets from the categorized, searchable Asset Browser (lazy-loaded in any scene, including Empty), hover & select objects with distinct 3D bounding boxes, drag objects smoothly across the terrain, scale uniformly or per-axis, configure declarative click interactions (section, url, event), and stack terrain generators. |
Clone the repository, create your local .env file, and start the PHP 8.5-FPM + Nginx stack from the project root:
git clone https://github.com/s-meiser/threeStage.git
cd threeStage
cp app/.env.example app/.env
docker compose --env-file ./app/.env up -d --buildOpen http://localhost:5547/ in your browser (configurable via HTTP_PORT).
Create .env, install PHP dependencies, and warm the Symfony cache:
cd app
cp .env.example .env
composer install
php bin/console cache:clearInstall Node dependencies and compile frontend assets via Webpack Encore:
npm install
npm run dev # one-off development build
npm run watch # rebuild on file changes
npm run build # optimized production bundleAlternatively, serve the application locally using the Symfony CLI:
symfony server:startThreeStage separates server delivery (Symfony + Twig + Encore) from a pure ES6 client-side editor engine:
ThreeStage/
├── compose.yaml # Local PHP-FPM & Nginx stack (port 5547)
├── Dockerfile # PHP 8.5-FPM Alpine image
├── docs/ # Branding & workspace screenshots
└── app/
├── src/Controller/EditorController.php
├── templates/
│ ├── editor.html.twig # Editor shell
│ └── editor/ # Menu bar, sidebar, tools & property panels
└── assets/
├── models/ # Global asset library (catalog.json, categorized .webp.glb & hq/ sources)
├── Controller/
│ ├── scene_editor_controller.js
│ └── Editor/
│ ├── SceneEditor.js # Core orchestrator
│ ├── Assets/ # Asset catalog, manifest, lazy GLB loader & shared resources
│ ├── Data/ # Constants, undo/redo history, scene state, groups & validation
│ ├── Scenes/ # Base scene setup
│ ├── World/ # Lighting, props & instanced scatter
│ ├── Terrain/ # Terrain mesh & procedural modifiers
│ ├── Viewport/ # WebGL renderer, outlines & waypoint markers
│ ├── Controls/ # Orbit, WASD/QE keyboard, placement & terrain drag-to-move
│ ├── Panels/ # Camera, object, material, marker & terrain UI
│ ├── UI/ # Menu bar, layer tree sidebar, workspaces & Asset Browser
│ ├── Files/ # Local snapshots & zero-dependency ZIP exporter
│ └── Templates/ # Empty & Waldweg scene templates
└── scss/ # Editor theme & component styles
3D Models — Creative Commons Attribution 4.0 (CC BY 4.0)
- TreeA by BotondBencsik
- Granite stone brown 02 by 3dhdscan
- Grass by Fred Drabble
- A Welcoming Sign by Raneman
Changes made: model textures were compressed to WebP (.webp.glb) and geometries were rescaled and positioned for real-time web rendering.
Public Domain Assets (CC0 1.0)
- Grass Medium 01 by Rico Cilliers and Rob Tuytel (Poly Haven — repacked with crossed ground-cover cards and WebP alpha atlas in
meadow-grass.webp.glb) - Forest Ground 01 by Rob Tuytel (Poly Haven)

