Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GARGANTUA Black Hole Raytracer

A real-time Schwarzschild black hole raytracer built with Three.js, WebGL 2, and GLSL.

GARGANTUA Preview

Features

  • Real-time Schwarzschild gravitational lensing
  • Null-geodesic ray integration
  • Procedural accretion disk rendering
  • Relativistic Doppler beaming
  • Gravitational redshift
  • Lensed procedural star field
  • Multiple camera presets
  • Cinematic camera mode
  • Adjustable physical and optical parameters
  • HDR bloom and post-processing
  • Debug visualization modes
  • Screenshot capture

Demo

A browser with WebGL 2 and hardware acceleration is required.

If GitHub Pages is enabled, the live demo will be available at:

https://INFP-coder.github.io/BlackHoleRaytracer/

Run Locally

Clone the repository:

git clone https://github.com/YOUR_USERNAME/BlackHoleRaytracer.git
cd BlackHoleRaytracer

Start a local HTTP server:

python3 -m http.server 8080

Open the following URL:

http://localhost:8080/

Do not open index.html directly with a file:// URL because the project uses JavaScript modules.

Controls

Control Action
Mouse drag Orbit camera
Mouse wheel Zoom
14 Select camera preset
Space Toggle cinematic mode
Alt+0Alt+9 Select debug view
Q Change rendering quality
P Toggle parameter panel
M Toggle ambient audio
H Toggle HUD
S Save screenshot
R Reset parameters

Rendering Modes

The application includes three quality profiles:

  • Standard: Lower resolution and fewer integration steps
  • High: Balanced quality and performance
  • Cinematic: Higher resolution and additional integration steps

For troubleshooting, start the application in safe mode:

http://localhost:8080/?safe=1&post=0

Run the built-in startup test:

http://localhost:8080/?selftest=1

Requirements

  • A modern browser with WebGL 2 support
  • Hardware-accelerated graphics
  • JavaScript ES module support
  • Python 3 or another static HTTP server for local development

Project Structure

BlackHoleRaytracer/
├── assets/
├── js/
│   ├── main.js
│   └── shaders.js
├── vendor/
│   ├── three.module.js
│   └── addons/
├── index.html
├── styles.css
├── LICENSE
└── README.md

Technology

  • Three.js
  • WebGL 2
  • GLSL
  • JavaScript ES Modules

Third-Party Software

This project includes or depends on Three.js and selected Three.js example modules. Three.js is distributed under the MIT License.

See the relevant third-party source files and license notices for details.

License

This project is licensed under the MIT License. See LICENSE for details.

About

A real-time Schwarzschild black hole raytracer built with Three.js and WebGL 2.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages