Your Cursor Is A Black Hole
The story behind The Weight of Light
Inspired by Gravitational Lensing on Wikipedia
Built with Three.js · EffectComposer (UnrealBloomPass, ShaderPass)
Techniques Gravitational Lens Shader · Chromatic Aberration · Bloom
Direction Turn the cursor into a black hole with simplified Schwarzschild geometry, bending a procedural star field and spiral galaxy in real time
Result A meditative WebGL star field where your cursor warps light, forms Einstein rings, and blacks out an event horizon — general relativity made tactile
The Story
In 1915, Einstein’s general relativity predicted that massive objects would bend the path of light. Four years later, during a solar eclipse, Arthur Eddington observed stars appearing slightly displaced from their true positions - their light bent by the sun’s gravitational field.
The universe works differently than we assumed.
Gravitational lensing is now one of astronomy’s most powerful tools. We use it to see galaxies hidden behind other galaxies. To detect invisible dark matter by its gravitational influence. To find planets around distant stars.
Mass curves space. Space tells light how to move.
The Take
What if you could hold that power in your cursor?
This experience gives you infinite mass. As you move across the star field, light bends around you. Stars duplicate and distort. A ring forms around your position - the Einstein ring, a perfect circle of bent light that occurs when source, lens, and observer align.
It’s physics made playful. The equations of general relativity - normally expressed in tensor calculus that takes years to master - become something you can feel intuitively. Pull your cursor through the galaxy and see how mass shapes the universe.
The text floats in space: “mass curves space / space tells light how to move.” It too bends around your position, distorting as you pass over it. Even words aren’t immune to gravity.
The Tech
Three.js with EffectComposer for post-processing. The gravitational lensing happens entirely as a screen-space shader effect.
The scene contains three layers:
- Star field: 2000 points with color variation (blue, white, orange-ish stars)
- Text plane: Canvas texture with the Einstein quote
- Galaxy: A procedurally generated spiral galaxy using radial point distribution
The magic happens in the post-processing chain:
Bloom Pass (UnrealBloomPass): Adds the glow that makes stars feel luminous rather than just bright points.
Gravitational Lens Pass: The custom shader that simulates lensing:
- Calculate vector from each pixel to the lens center (mouse position)
- Compute deflection using simplified Schwarzschild geometry: deflection = mass / distance
- Apply deflection by shifting UV coordinates toward the mass (light bends toward gravity)
- Add chromatic aberration - different wavelengths refract differently
- Draw the Einstein ring as a circular glow at the characteristic radius
- Black out the event horizon (nothing escapes)
Vignette Pass: Subtle darkening at edges for cinematic framing.
The mouse position is smoothly interpolated to prevent jarring jumps. The lens effect intensifies near center and falls off with distance.
On mobile, touch input works the same way. Drag your finger across space and carry a black hole with you.
The Experience
Move your cursor slowly through the star field.
Watch the stars near your cursor. They’re not where they should be. They’ve shifted, duplicated, smeared into arcs.
Move over the galaxy. Watch it stretch and distort, multiple images forming as light takes different paths around your infinite mass.
Hold still near the center and observe the Einstein ring - that perfect circle of bent light that only forms with precise alignment.
The experience is meditative. There’s no goal, no completion state. Just you and a universe that bends to your presence.
The info text appears after first movement: a reminder of what you’re seeing, what you’re doing. Mass curves space. You’re the mass now.
Experience The Weight of Light
This blog post was AI generated with Claude Code. Authored by Artificial Noodles.