I'll build a fully procedural planet generator with tectonic plates, terrain, erosion, climate, oceans, clouds, and atmosphere. Let me start by exploring the project structure.
Now let me install the required packages for 3D rendering and noise generation.
Let me install the TypeScript types for Three.js.
Now I'll build the procedural planet generator. Let me create the core files step by step.
First, the noise utility module:
Let me fix the unused variable and continue with the planet generator:
Now let me create the planet generator engine:
Now let me create the Planet rendering component with custom shaders:
Now let me create the Controls component:
Now let me create the Starfield background component:
Now let me create the tectonic plate overlay component:
Now let me create the main App component:
Now let me update the HTML title:
Let me check main.tsx and then build:
Let me build the project to check for errors:
The build succeeded! Let me check the CSS to make sure there are no conflicting global styles:
The build is successful. Let me add a few polish improvements - a biome legend and fix the tectonic overlay to be more robust:
Now let me update the App to include the Legend:
Let me also improve the TectonicOverlay to be more robust:
Let me rebuild to verify everything works:
The build is successful. Let me do a final review of the complete application to ensure everything is polished:
The app builds successfully. However, I noticed the ocean sphere might render over land areas. Let me fix the ocean shader to properly clip to water areas using the heightmap:
Now update the ocean material to include the new uniforms:
Let me rebuild to verify:
Build successful! Let me verify the sun direction update effect handles all materials properly:
The app is looking solid. Let me verify the Controls component handles integer values properly for plate count:
Let me improve the slider value display to show integers properly:
Let me do a final build:
The build is successful! Here's a summary of the complete procedural planet generator I've built:
Procedural Planet Generator
Core Simulation Systems
-
Tectonic Plate Simulation — Generates random plate centers across the sphere with movement vectors. Convergent boundaries create mountain ranges via ridged noise, while divergent boundaries create rifts. Each plate is classified as continental or oceanic.
-
Terrain Height Generation — Uses multi-octave simplex noise with domain warping for realistic continent shapes. Plate boundary stress creates mountain ranges. Detail noise adds fine surface features.
-
Hydraulic Erosion — Simulates water flow from high to low points across multiple iterations, smoothing valleys and creating realistic drainage patterns.
-
Climate Simulation — Temperature decreases with latitude and altitude. Moisture depends on ocean proximity and wind patterns. These combine to determine biomes (tundra, taiga, grassland, forest, rainforest, savanna, desert, etc.)
-
Ocean Rendering — Custom GLSL shader with animated waves, specular highlights, fresnel effects, and depth-based coloring. Properly clipped to only render where terrain is below sea level.
-
Cloud & Atmosphere — Procedural cloud layer with animated movement and lighting. Atmospheric scattering shader approximates Rayleigh scattering with day/sunset color transitions.
Interactive Features
- Full parameter control — Plate count, continent scale, mountain height, erosion strength, sea level, temperature range, moisture scale
- Display controls — Rotation speed, cloud speed, sun angle, tectonic plate overlay toggle
- Real-time generation — Click "Generate New Planet" for a completely new world
- Camera controls — Drag to orbit, scroll to zoom
- Biome legend — Visual reference for all terrain colors
- Planet stats — Live plate count and seed display
- Starfield background — 3000 procedurally placed colored stars
Tech Stack
- React 19 + TypeScript
- React Three Fiber / Three.js for 3D rendering
- Custom GLSL shaders for all planetary layers
- Tailwind CSS for the dark-themed UI
- Simplex noise for procedural generation
Files built: src/engine/noise.ts, src/engine/planetGenerator.ts, src/components/Planet.tsx, src/components/Controls.tsx, src/components/Starfield.tsx, src/components/TectonicOverlay.tsx, src/App.tsx, index.html, src/components/Legend.tsx