A WebGL-based black hole simulation with gravitational lensing, accretion disk, and realistic physics.
- Real-time gravitational lensing effects
- Volumetric accretion disk with physically-based lighting
- Blue noise temporal anti-aliasing
- Interactive camera controls
- Cubemap environment reflection
The following texture files need to be placed in the specified directories:
Place these 6 files in /public/assets/cubemap-test/space/
:
px.png
- Positive X face (right)nx.png
- Negative X face (left)py.png
- Positive Y face (top)ny.png
- Negative Y face (bottom)pz.png
- Positive Z face (front)nz.png
- Negative Z face (back)
These should be space/star field images for the environment mapping.
Place this file in /public/assets/noise-textures/
:
bn.png
- Blue noise texture for temporal anti-aliasing
This should be a 1024x1024 blue noise pattern.
- Install dependencies:
npm install
-
Add the required texture files (see Requirements above)
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser
-
Click "Enter the Blackhole" to view the simulation
- Mouse drag: Rotate camera around the black hole
- Mouse wheel: Zoom in/out
- Right-click drag: Pan camera
The implementation includes:
- Custom GLSL vertex and fragment shaders
- Volumetric ray marching for the accretion disk
- Gravitational lensing physics simulation
- Simplex noise for disk turbulence
- Real-time cubemap reflection sampling
- Blue noise dithering for smooth temporal effects
Built with Next.js, React Three Fiber, and Three.js.