I'll create a Minecraft clone with React Three Fiber featuring a toroidal (wrapping) world, procedural biomes, textures, audio, and post-processing effects. Let me start by exploring the project structure.
Now let me build the game. Starting with core constants, procedural noise, and texture generation:
Now the procedural texture atlas (canvas-generated pixel-art textures):
Now the world generation with toroidal biomes:
Now the chunk mesher with baked ambient occlusion:
Now the procedural audio engine (Web Audio synthesis, no samples):
Now the state store and shared environment state:
Now the procedural sky, day/night cycle, and lighting:
Now the player controller with physics, block interaction, and toroidal wrapping:
Now post-processing effects and the HUD:
Build succeeded. Now let me polish several details — cloud tiling, underwater overlay reactivity, and page setup:
Let me add a polish touch — toast notifications for biome discovery and world wrapping:
Let me verify the normal pass handling in react-postprocessing to ensure SSAO works correctly:
Toruscraft is built — a complete voxel sandbox running on a donut-shaped world. Everything (terrain, textures, audio) is generated from a single seed with no external assets.
Toroidal world wrapper
World stores a 128 × 128 × 48 voxel grid where every accessor (get/set/raycast/collision) wraps X and Z, so there are no edges.
- All noise is periodic (
perlin2/fbm2/ridge2 wrap their lattice modulo the cell count and double per octave), so terrain, biomes and caves are seamless across the seam.
- Each of the 64 chunk meshes is re-positioned every frame into the torus tile nearest the camera, so you can walk forever; fog hides the flip point. The minimap scrolls seamlessly and a toast fires when you lap the world.
Biomes & world gen
Ocean, beach, desert, savanna, plains, flower fields, forest, taiga, snowy tundra and mountains — chosen by temperature/humidity/altitude fields, each with its own surface blocks, tree species (oak / spruce / cactus), flowers, tall grass, mushrooms and dead bushes. Plus ore veins, gravel pockets, 3-D noise caves, oceans, shorelines, ice and snow lines.
Procedural textures & audio
- 38 pixel-art tiles (grass variants, bark, rings, cobble, bricks, ores, ice, flowers…) drawn per-pixel into a single canvas atlas, also reused for the HUD hotbar icons, break-particle colors and a seamless cloud texture.
- Web Audio synthesis: material-specific footstep noise bursts, dig/place transients, splashes, altitude-driven wind, birdsong, an underwater lowpass, and a generative pentatonic music box with a synthesized reverb impulse.
Mechanics
AABB voxel collision, sprinting, jumping, swimming, double-tap flight, DDA block raycasting with a highlight box, break/place/pick with cooldowns, block-break particle physics, an animated held-block viewmodel, head bob, FOV kick, hotbar (keys/wheel), day-night cycle with sun/moon/stars, and a live telemetry panel.
Post FX
EffectComposer with a normal pass driving SSAO, PCSS soft shadows (drei), bloom, vignette, optional chromatic aberration and SMAA — each togglable from the menu, on top of per-vertex baked ambient occlusion in the chunk mesher.
Files built: src/game/constants.ts, src/game/noise.ts, src/game/textures.ts, src/game/world.ts, src/game/mesher.ts, src/game/audio.ts, src/game/store.ts, src/game/env.ts, src/game/build.ts, src/components/Terrain.tsx, src/components/Environment.tsx, src/game/preview.ts, src/components/Player.tsx, src/components/Particles.tsx, src/components/Effects.tsx, src/components/Minimap.tsx, src/components/HUD.tsx, src/App.tsx, src/components/Menu.tsx, index.html, src/index.css