How I built a black hole in WebGL

Gargantua is the centre of this site: the black hole the six sections are Interstellar. In the Observatory you can see it full The first version was a five-layer trick: a disk, a halo and even an Einstein The current version does the opposite. For every pixel, a shader casts a ray The photon orbit equation, d²u/dφ² = −u + 1.5·rs·u², can be rewritten as a a = −1.5·rs·h²·r / |r|⁵, where h² = |r × v|² is computed once per ray. With that, each step is a two-line vec3 acc = -1.5 * uRs * h2 * pos / (r2 * r2 * r); vec3 nextPos = pos + dir * dt + 0.5 * acc * (dt * dt); float n2 = dot(nextPos, nextPos)
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in