• HTML 99.5%
  • JavaScript 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Lodri b6457427f7 ci: pin wranglerVersion 4 (fix npx-canceled)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 10:02:54 +02:00
.github/workflows ci: pin wranglerVersion 4 (fix npx-canceled) 2026-07-26 10:02:54 +02:00
public Initial commit: WebGL2 black hole GR ray tracer 2026-07-14 03:50:22 +02:00
.gitignore Initial commit: WebGL2 black hole GR ray tracer 2026-07-14 03:50:22 +02:00
README.md Initial commit: WebGL2 black hole GR ray tracer 2026-07-14 03:50:22 +02:00
worker.js Initial commit: WebGL2 black hole GR ray tracer 2026-07-14 03:50:22 +02:00
wrangler.jsonc Initial commit: WebGL2 black hole GR ray tracer 2026-07-14 03:50:22 +02:00

Black Hole — real-time GR ray tracer

A single-file WebGL2 black hole visualization deployed as a Cloudflare Worker.

Overview

  • Real-time geodesic ray tracing in the Schwarzschild metric
  • Relativistic accretion disk: Doppler beaming (intensity and color shift), gravitational redshift, temperature profile T ~ r⁻³/⁴
  • Photon ring: GR light-bending creates the characteristic "shadow" — rays with impact parameter < 3√3 rₛ are captured
  • Lensed starfield: procedural star background bent by spacetime curvature
  • Post-processing: bloom (bright-pass + 2-pass Gaussian blur at ¼ res), chromatic aberration, ACES tone-mapping, vignette, noise dither
  • Two camera modes: [H] toggles between distant orbit and event-horizon free-look POV with infall loop and observer-blueshift
  • Adaptive quality based on framerate

Physics


Deploy

npx wrangler deploy

Deployment URL: https://c51bd85e.blackhole-7gr.pages.dev

Custom domain (blackhole.vaked.dev)

The Cloudflare Worker route is configured but a CNAME DNS record must be manually added:

  1. Cloudflare Dashboard → vaked.dev → DNS → Records
  2. Add record:
    • Type: CNAME
    • Name: blackhole
    • Target: blackhole-7gr.pages.dev
    • Proxy status: Proxied (orange cloud)
  3. Wait 1–2 minutes for SSL provisioning

Tech

  • WebGL2 — no frameworks, one HTML file
  • Cloudflare Pages for deployment
  • Vanilla JS, zero dependencies

License

MIT