Skip to content
All work

Personal · 2026 · Web

The Pale Blue Dot

A 3D journey through space in WebGL, recreating Carl Sagan's 'Pale Blue Dot' passage.

Role
Developer
Status
Completed
Stack
Three.js · WebGL · GLSL · GSAP · Framer Motion

The idea

"Look again at that dot. That's here. That's home. That's us." This project is a tribute to Carl Sagan's reflection on our place in the universe. I wanted a page that makes you stop for a moment, moving from a normal portfolio view to a look at our shared home from far away.

How it works

1. Earth's layers

The globe is built from several layers:

  • Surface: 10k diffuse, bump, and specular maps for terrain and ocean reflections.
  • Night lights: a separate mesh with an additive material that shows city lights on the dark side of the planet.
  • Clouds: a floating sphere with 8k textures that drifts independently of the surface, which gives parallax depth.
  • Atmosphere: a custom GLSL Fresnel shader that simulates atmospheric scattering (the blue rim glow) depending on the camera angle.

2. Starfield and shaders

The background is a procedurally generated starfield of 15,000 points.

  • Stars are colored by real stellar temperatures: O-type blue, G-type yellow, M-type red.
  • Twinkling runs on the GPU. Instead of updating each point on the CPU, a vertex shader uses each star's coordinates as a seed for a sine-wave opacity oscillation.
  • To avoid square pixels, a fragment shader draws a soft radial gradient with a power-function falloff for each star.

3. Scroll-driven steps with GSAP

The experience is a series of steps. I wrote a custom scroll engine that:

  • intercepts wheel and touch events to trigger discrete transitions,
  • uses GSAP to animate the earthGroup rotation, its position, and the PerspectiveCamera zoom at the same time,
  • locks input during an animation so the sequence can't be broken.

4. Sound and text

In the outro, ambient music fades in. A custom Framer Motion typewriter reveals Sagan's words slowly, in sync with the camera drifting into the void.

Built with

  • Three.js and WebGL for 3D rendering and scene management.
  • GLSL shaders for the atmosphere and the starfield.
  • GSAP for the multi-variable animations.
  • Framer Motion for UI transitions and the text animation.
  • AgX tone mapping for filmic color and high-dynamic-range light.

What I learned

The hardest part was the perspective transition. Moving the camera from a close-up of one city to a distance where Earth is a single pixel meant tuning the camera's near and far planes and its field of view. Keeping it smooth on mobile with 10k textures and thousands of shader-driven particles taught me a lot about GPU memory and texture anisotropy.