← Gallery
Simathon 01Black HoleHas videoHas code

kerr-neumann metric blackhole

venkat

Bending Light, Not the Rules: A Real-Time Hamiltonian Raytracer for Kerr-Newman Spacetime.

Still from kerr-neumann metric blackhole

What it does

Most hackathon black holes are optical illusions—standard 3D rasterization or noise textures faking spatial warping. We threw that out. This project is a raw, numerical physics engine simulating the literal tensor geometry of spacetime. The Hamiltonian Difference Instead of using simplified Newtonian approximations, we modeled the universe using Hamiltonian Mechanics. Our engine calculates the Hamiltonian energy equation of a massless photon traveling through a Kerr-Newman metric (a charged, spinning black hole). By numerically solving Hamilton’s equations of motion—calculating the derivatives of momentum and position at every step—we generate the true, physical geodesic paths of light falling into the gravity well. Computational Prowess Solving continuous tensor calculus per-pixel is computationally massive. To render this interactively without melting the GPU, we wrote a custom 4th-Order Runge-Kutta (RK4) integrator directly in GLSL, optimized with: • Adaptive Ray-Stepping: Dynamically scales step size based on horizon proximity, saving immense computing power in empty space. • Coordinate Singularity Management: The math is so accurate it naturally encounters real-world division-by-zero singularities at Boyer-Lindquist poles, patched via spatial clamping for rendering stability. • Dithered Volumetrics: High-frequency ray jitter shatters moiré banding, allowing us to drop loop counts while delivering cinematic, artifact-free plasma. The result is a fully interactive simulation where gravitational lensing and frame-dragging are physically simulated, proving you don't need to fake physics to make it beautiful.