terrain_miner Svelte Themes

Terrain_miner

Scalar Mine is a browser-based terrain mining prototype built with Svelte, Vite, and Three.js. It generates chunked scalar-field terrain, lets you dig smooth holes into the ground, and remeshes edited chunks in the background with a worker pool.

Scalar Mine

Scalar Mine is a browser-based terrain mining prototype built with Svelte, Vite, and Three.js. It generates chunked scalar-field terrain, lets you dig smooth holes into the ground, and remeshes edited chunks in the background with a worker pool.

The terrain is SDF-like: solid ground and empty space are represented as a density field, and digging subtracts smooth spherical edits from that field. Chunks are rebuilt from the density == 0 surface, which avoids mesh boolean artifacts and keeps holes clean.

Features

  • Infinite-feeling chunked terrain around the player
  • Smooth spherical digging with a visible brush preview
  • Capsule character movement and terrain collision
  • Camera collision that avoids clipping through the ground
  • Background chunk meshing with ?pool=false available for sync-mode debugging

Controls

  • WASD move
  • Space jump
  • Shift sprint
  • Mouse move to look after pointer lock
  • Left click dig
  • Mouse wheel changes brush size
  • Shift + mouse wheel zooms the camera

Run

npm install
npm run dev

Open the local Vite URL in your browser. Use ?pool=false to disable worker pools for comparison.

Top categories

Loading Svelte Themes