Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terrain Studio

A procedural terrain generator — a faithful functional reconstruction of terrains.zyfod.dev, built on the same stack (Vite + React + Three.js, raw WebGL ShaderMaterial).

The terrain engine reuses the original's GLSL verbatim (noise → climate / biome → height field → albedo / lighting), so a given seed produces the same world. The default scene (highlands, seed 1337, earth palette) matches the source.

Run

npm install
npm run dev        # http://localhost:5173
npm run build      # production bundle in dist/

Verify (headless WebGL)

npx playwright install chromium   # one-time
node scripts/verify.mjs           # boots app, checks for shader/console errors
node scripts/interact.mjs         # checks controls drive the engine

Architecture

src/
  shaders/
    lib.js          GLSL chunk library (uniforms, noise, climate/biome,
                    height field, palette, lighting) — extracted verbatim
    terrain.js      composed terrain vertex + fragment shaders
    water.js        composed water vertex + fragment shaders
  engine/
    TerrainEngine.js  Three.js scene, board mesh + water plane, ShaderMaterial,
                      uniform mapping (config -> uniforms), orbit camera, minimap
  state/
    config.js       default config, terrain / noise / palette presets, base
                    palette — extracted verbatim from the source bundle
  ui/               React control panels matching the source CSS
    Topbar, LeftPanel, RightPanel, controls, icons
  App.jsx           wires UI state to the engine
  index.css         the source stylesheet (byte-for-byte)

Features

  • Geography / terrain: preset (7), seed, height scale, sea level, island falloff
  • Noise: 9 presets, scale, strength, FBM octaves / persistence / lacunarity / ridge / warp
  • Climate & biomes: biome scale, temperature / moisture bias, snow line, biome debug
  • Palette: 15 presets recoloring the terrain and water in real time
  • Water: animated ripples, foam, depth grading, reflection / detail / wave complexity
  • Environment: sun azimuth / elevation, fog, normal strength, AO, wireframe, chunk grid
  • Camera: orbit + reset, preview (auto-rotate); minimap top-down preview; PNG export

Scope note

This is a functional reconstruction, not a byte copy of the original 936 KB bundle. The board (studio) terrain mode is fully implemented; the original's infinite-chunk LOD streaming and first-person walk mode are approximated.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages