An interactive 3D journey through the solar system
"Let yourself be carried away by the faint light of the stars and feel the heartbeat of the universe."
- About the Project
- Features
- Technologies
- Project Structure
- Architecture
- Controls
- Installation
- Easter Eggs
- Performance
- Author
- License
Cosmos Museum is not a simple digital planetarium. It is a visual sanctuary, an interactive ode to the universe conceived to inspire awe and disconnection from the everyday world.
Every planet has been modeled with procedurally generated textures created in real time through 3D noise systems, custom GLSL shaders, and a carefully optimized rendering pipeline. From Mercury's craters to Neptune's winds, each surface tells a story written in code and light.
The result is an experience that lives at the intersection of science, art, and engineering β a place where the immensity of the cosmos feels closer to home.
Navigate freely through a complete solar system with fluid cameras, intuitive controls, and an interface that disappears to leave you alone with the universe.
- 10 celestial bodies β Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, and the Moon
- Procedural textures generated by 3D noise algorithms β no external image dependencies for surfaces
- Asteroid belts β 8,000 asteroids in the main belt + 8,000 in the Kuiper belt + 30 asteroids with Keplerian elliptical orbits
- Comets β random swarms with custom GLSL tails
Press F to enter ship mode. Control your spacecraft with WASD and mouse β speed, direction, and total freedom to traverse the solar system as a pilot.
Double-click any planet to engage the warp drive. A 4-phase cinematic transition (charge β jump β tunnel β exit) with gravitational distortion, lightning bolts, stretched stars, and a vortex tunnel will transport you to your destination.
Activate the screensaver with the pause button and let the universe flow on its own. The camera gently orbits between planets β perfect as ambient background.
Press P to capture your current view. The photo includes cinematic bars, a watermark, and the name of the focused planet.
A universe built without heavy frameworks β pure code, pure performance.
| Technology | Purpose |
|---|---|
| Three.js r128 | 3D rendering engine and WebGL |
| GLSL Shaders | Procedural generation, atmosphere effects, stars, comets, and sun |
| Vanilla JavaScript | Application logic, interactions, and state |
| HTML5 / CSS3 | Responsive glassmorphic user interface |
| GSAP 3.12 | Smooth UI and camera animations |
| Lucide Icons | Modern lightweight iconography |
| Shader | Description |
|---|---|
| Twinkling Starfield | 3,000 stars with 6-point shape and twinkle animation |
| Sun Raymarcher | Procedural sun surface with 4D noise, prominences, and rings |
| Fresnel Atmosphere | Luminous rim effect on planets with atmosphere |
| Rayleigh Scattering | Realistic atmospheric scattering with multi-scatter |
| Comet Tail | Comet tails generated from noise textures |
| Nebula Stardust | 800 stardust particles with animated sparkle |
cosmos-museum/
βββ index.html # Main entry point
βββ script.js # Application core (~4,600 lines)
βββ styles.css # Interface styles
βββ solar-effects.js # Solar prominences and solar wind particles
βββ eccentric-asteroids.js # Asteroids with Keplerian elliptical orbits
βββ comets.js # Comets with custom GLSL shaders
βββ patch.js # Runtime patches
βββ audio/
β βββ piano.mp3 # Ambient soundtrack
βββ img/
β βββ textures/ # Background and asteroid textures
β βββ *.jpg, *.webp # Planet and interface textures
βββ models/ # 3D models (reserved)
The application follows a per-frame deferred loading pattern β each celestial body is built on a separate frame to keep the loading animation smooth.
Deferred Loading
β
βββ Procedural textures (Canvas 2D + 3D noise)
βββ Background nebula (900u sphere + 800 particles)
βββ Sun (GLSL raymarcher shader on billboard)
βββ 8 planets (128-segment sphere + glow + orbit + label)
β βββ Earth β clouds + Moon
β βββ Jupiter β 4 Galilean moons
β βββ Saturn β procedural rings (C/B/Cassini/A/Encke/F)
β βββ Uranus β thin dark rings
βββ Main asteroid belt (InstancedMesh Γ 8,000)
βββ Kuiper belt (InstancedMesh Γ 8,000)
βββ Keplerian asteroids (InstancedMesh Γ 30)
βββ Solar effects (prominences + solar wind Γ 600 particles)
βββ Post-processing (EffectComposer + UnrealBloomPass)
- RenderPass β Base scene
- UnrealBloomPass β Soft glow (strength: 0.05, radius: 0.5, threshold: 0.92)
- Final composition β UI overlay on WebGL canvas
| Action | Control |
|---|---|
| Orbit | Mouse drag |
| Zoom in / out | Mouse wheel |
| Select planet | Left click |
| Interstellar travel | Double click |
| Key | Action |
|---|---|
F |
Spaceship flight mode |
T |
Auto-tour |
M |
Ambient music |
P |
Capture photo |
1 - 9 |
Quick-jump to planets |
β β |
Navigate between planets |
Esc |
Exit / close panel |
| Key | Action |
|---|---|
W / S |
Forward / Backward |
A / D |
Turn left / right |
Q / E |
Lateral roll |
Space |
Ascend |
Shift |
Descend |
Esc |
Exit ship mode |
This project requires no build tools or bundlers. However, to avoid CORS restrictions when loading WebGL textures, it must be run through a local server.
# Clone the repository
git clone https://github.com/sebastianvasquezechavarria1234/cosmos-museum.git
# Enter the directory
cd cosmos-museumOption A β Node.js:
npx serve .Option B β Python:
python -m http.server 8000Open your browser at http://localhost:3000 (or the port your server indicates).
The cosmos holds secrets for those who dare to look for them.
β β β β β β β β B A
Activates rainbow mode for 10 seconds. All planets shine with the colors of the spectrum.
Type MURPH with your keyboard. A wormhole will take you to Earth accompanied by an Interstellar quote.
Type TARS to receive a random quote from the TARS robot in Interstellar.
The project is optimized to maintain 60 FPS even with thousands of objects on screen.
| Element | Count | Technique |
|---|---|---|
| Main belt asteroids | 8,000 | InstancedMesh β single draw call |
| Kuiper belt asteroids | 8,000 | InstancedMesh |
| Keplerian asteroids | 30 | InstancedMesh with per-instance color |
| Twinkling stars | 3,000 | Point sprites with vertex shader |
| Solar wind particles | 600 | Points with custom fragment shader |
| Stardust | 800 | Points with animated sparkle |
| Comets | 3-5 per swarm | Cross-billboard dual plane |
Key optimizations:
- Per-frame deferred loading for smooth intro sequence
InstancedMeshfor thousands of asteroids with a single draw callpreserveDrawingBuffer: truefor screenshots without visual impactMath.min(devicePixelRatio, 2)to prevent over-rendering on HiDPI screens- Pixel ratio capped at 2x across all devices
Created by Sebastian Vasquez β software developer and space enthusiast.
"Every line of code has been meticulously crafted as a brushstroke of light in the void, creating a space of profound stellar contemplation where the immensity of the universe feels closer to home."
- Portfolio: sebas-dev.vercel.app
- GitHub: sebastianvasquezechavarria1234
This project is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
You are free to share, adapt, and use this project even for commercial purposes, as long as you provide attribution to the original author.
Built with curiosity and starlight
Made with β€οΈ by SebastiΓ‘n V
