Trident is a browser-based Source-style level editor built as a Bun monorepo. It is aimed at fast blockouts and quick iteration, with brush tools, mesh editing, material authoring, entity placement, lighting, imports, exports, and optional AI-assisted asset generation.
The public GitHub Pages build is a static demo of the editor shell. The local development build includes the lightweight Vite API routes used for Fal-powered texture and model generation.
- Brush primitives for cube, cylinder, cone, sphere, stairs, and custom polygon blockouts
- Prop and model placement, including GLB import
- Entity and light placement for common gameplay and scene setup tasks
- Material library editing with texture slots, UV controls, and reusable materials
- Scene save/load and export flows, including
.whmap, glTF, and engine export actions - A standalone Three.js runtime package for loading structured scene exports in vanilla games
- Optional AI texture and 3D generation backed by Fal when running locally with a server-side API key
apps/editor: Vite + React + TypeScript editor applicationpackages/editor-core: scene document, command stack, selection, and event buspackages/geometry-kernel: brush and mesh operationspackages/render-pipeline: render-facing scene and viewport contractspackages/tool-system: tool registry and tool state machinespackages/shared: shared types and utilitiespackages/three-runtime: vanilla Three.js loader for runtime scene exportspackages/workers: worker task contracts and manager codeapps/three-runtime-playground: minimal Vite + TypeScript app that exercises the runtime loader
- Bun 1.3 or newer
- A modern desktop browser
- A Fal API key if you want the AI generation features locally
bun installStart the editor in development mode:
bun run devThat runs the Vite app in apps/editor and includes the local API routes for AI features.
bun run buildThis produces the static site output in apps/editor/dist.
bun run typecheckTypecheck or build the standalone Three runtime playground:
bun run typecheck:three-runtime
bun run build:three-runtimeWhen the editor opens, you can start blocking out a space immediately:
- Use the creation toolbar to place brush shapes, props, lights, and entities.
- Select objects in the viewport and use the inspector and material panels to adjust transforms, materials, UVs, and other properties.
- Save your scene as
.whmap, or export it as glTF or through the engine export action from the File menu.
The editor is designed around fast iteration, so most of the workflow is direct manipulation in the viewport with supporting controls in the floating panels and sidebars.
- Use
.whmapfor editor-native save/load and round-tripping. - Use
Export Runtime Bundlewhen you want to ship a map to a vanilla Three.js game. - The bundle contains a small
scene.runtime.jsonmanifest plus external asset files underassets/, instead of stuffing textures into one giant JSON blob. - Load the manifest with
@web-hammer/three-runtime, which rebuilds geometry, materials, lights, model assets, and preserves node physics metadata for your game code. - Runtime package docs and code examples live in
packages/three-runtime/README.md. - For large web worlds, do not export one giant scene and preload it all. Export streamable level chunks and load/unload runtime bundles on demand.
- If you need shared heavy assets across many chunks, keep them external and let chunk manifests reference them instead of copying them into every bundle.
The playground app in apps/three-runtime-playground demonstrates that workflow outside the editor.
Trident only requires an environment variable if you want AI model or texture generation.
Create apps/editor/.env.local with:
FAL_KEY=your_fal_api_key_hereFAL_KEY is read on the server side by the Vite dev server plugins in apps/editor/server. It is not needed for the static GitHub Pages demo.
- Create an account or sign in at Fal.
- Open the dashboard and go to the API keys section.
- Create a new key.
- Copy the key into
apps/editor/.env.localasFAL_KEY=....
If you only want to try the public demo on GitHub Pages, you can skip this entirely. The demo is intentionally static, so the AI generation routes are not deployed there.
This repository includes a GitHub Actions workflow that builds apps/editor as a static site and deploys it to GitHub Pages.
The workflow lives at .github/workflows/deploy-pages.yml and assumes the site is hosted from the repository path, so the Vite base path is set automatically for Pages builds.
MIT. See the LICENSE file for details.