An interactive, real-time procedural soil sandbox built with Three.js. A single displaced ground plane is reshaped and re-shaded entirely on the GPU into mounded, cracked, mossy, wind-blown terrain — then framed with a cinematic post-processing stack (volumetric clouds, depth of field, bloom and film grade). Everything is driven live from an on-screen control panel.
Despite the repository name (
GrassSystemThreeJS), the app has grown into a full soil/terrain studio: soil shaping, moss, grass, models, weather and camera all in one scene.
.glb at runtime. Upward-facing faces accumulate their own displaced moss layer, sharing the ground's moss textures.RoomEnvironment.^0.185 — rendering, shaders, post-processing passes^0.20 — the control panel^6 — dev server and buildShaders are injected into MeshStandardMaterial via onBeforeCompile, so the procedural soil, grass and moss all receive the scene's real lighting, shadows and fog.
Prerequisites: Node.js (18+ recommended) and a browser with WebGL2.
# install dependencies
npm install
# start the dev server (Vite)
npm run dev
# build for production into dist/
npm run build
# preview the production build
npm run preview
Then open the URL Vite prints (defaults to http://localhost:5173).
Most heavy features (Grass, Moss Cover, Dry Cracks, Clouds, Model, Depth of Field) are off by default — enable them from their folders. Use the 🎲 Randomize Seed buttons to pan each noise field to a fresh layout.
index.html # canvas, styled lil-gui panel, letterbox + credit overlay
vite.config.js # Vite config
src/
main.js # scene, lighting, soil shader injection, all GUI wiring, render loop
grass.js # GPU-instanced, wind-reactive grass glued to the terrain height field
clouds.js # volumetric cloud raymarch (depth prepass → low-res march → composite)
postfx.js # EffectComposer stack: DoF → bloom → tone map → film grade
model.js # GLB loader + per-model moss-accumulation shader
public/
Ground048_* # PBR soil texture sets (color/AO/displacement/normal/roughness)
Ground103_*
Moss002_* # PBR moss texture set
*.glb # bundled models
Ground048, Ground103, Moss002).MIT © 2026 mohamedachrefelouafi
$ claude mcp add GrassSystemThreeJS \
-- python -m otcore.mcp_server <graph>