What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Jonás Javier Encarnación’s Gargantua visualization creates its black-hole image by tracing a light ray for each pixel in a WebGL shader—not by placing a pre-painted ring and disk over a black circle. The ray’s path decides whether that pixel shows a lensed star, light from the accretion disk, or the black shadow. That approach makes the ring and warped views emerge from the rendering, but it also makes performance and visual cleanup part of the engineering problem.

Why trace light instead of drawing a ring?

Encarnación says his early version assembled the image from separate elements: a disk, a halo and an Einstein ring on a plane. Their boundaries revealed a seam. In the later version, the shader starts with a ray from the camera and follows it around the black hole. Depending on its path, the ray escapes toward the background, falls in, or crosses the disk.

Approach What it does Trade-off described by the author
Earlier layered plane Combines a disk, halo and ring as separate visual elements. Simpler to assemble, but the pieces exposed a seam.
Current per-pixel ray tracing Follows each pixel’s ray and uses its path to determine the visible light or shadow. Lensing effects follow from the paths, at the cost of more computation and shader complexity.

In the current renderer, a ray that escapes samples the star field in its outgoing direction; a captured ray renders black; a ray that crosses the disk can contribute disk light. Encarnación describes this as turning the task around: rather than drawing the black hole, follow the light. The resulting photon ring, view of the disk’s far side, secondary image and lensed background stars are consequences of the ray paths in this model.

What physics does the shader model?

The ray equation Encarnación reports is d²u/dφ² = −u + 1.5·rs·u². The shader reformulates the orbit as a Cartesian central-force acceleration and advances it with a Verlet-style integration step. This is the mechanism that bends the view of the background and disk around the shadow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The spacetime model is non-rotating Schwarzschild, not Kerr. The disk rotates, but that does not make the black hole itself a rotating Kerr simulation. Encarnación says per-pixel Kerr ray tracing was too expensive for a browser in this project, so the choice is a rendering and performance compromise—not a complete model of every rotating-black-hole effect.

How the accretion disk gets its texture and color

Procedural texture in disk coordinates

The disk extends from 1.58 to 17 times the horizon radius, according to Encarnación. Its fractal noise is evaluated at the point where a ray crosses the disk plane, using log-radius coordinates. This places the texture in the disk’s own geometry rather than treating it as a fixed screen-space overlay.

Rotation without indefinitely winding the texture

The disk material rotates at differential Keplerian rates in the author’s implementation; the inner edge moves about 35 times faster than the outer edge. A continuously rotating texture would wind into rings too fine to resolve. To avoid that, the renderer uses two copies offset by half a cycle and fades between them every 20 seconds.

Doppler beaming and gravitational redshift

The shader also applies Doppler beaming and gravitational redshift. With the parameters used for this rendering, Encarnación reports that the approaching side appears a little more than twice as bright as the receding side. Its light shifts toward cream, while the receding side shifts toward copper. These are outcomes of this project’s chosen model and settings, not universal brightness or color values for black-hole disks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keeping bloom from filling in the shadow

Bloom initially spread disk light into the dark centre. Encarnación’s fix was to save the image before bloom, then selectively restore those pre-bloom pixels in dark parts of the shadow. He reports that this reduced the centre brightness from 106.8 to 18.2. In the resulting image, the truly black region measures 118 × 73 pixels within a 142-pixel shadow. Those are measurements of the rendered image, not physical dimensions or general black-hole proportions.

How the renderer manages browser performance

Ray-step tiers and accumulation

Encarnación reports 190 ray steps per pixel for the normal tier and 340 for the deep tier, which also renders at higher resolution. The deep tier is reserved for desktop capability signals in his implementation. The image accumulates over eight frames with small offsets to smooth edges, and the Observatory stops drawing when idle.

Asynchronous shader compilation

In Encarnación’s account, shader compilation initially blocked the page for 2.4–2.7 seconds. He switched to compileAsync with KHR_parallel_shader_compile; in his setup, that removed the blocking compilation task. He also reports mobile Lighthouse total blocking time falling from 7.95 seconds to about 2 seconds. These are project-reported figures; the article does not establish an independent replication or a complete benchmark protocol.

Adaptive resolution on phones

On phones, the renderer starts at one pixel per point. If performance holds, it can step up to 1.25 and then 1.5; if the phone stutters, resolution steps down. This gives the scene room to use more detail on capable devices without assuming every phone can sustain the same workload.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A flat fallback when WebGL is not a good fit

The site can serve a flat 2D version in conditions such as unavailable WebGL2, software rendering, a slow network or limited memory. The text and routes remain available even when the interactive scene does not. A companion engineering article describes additional capability detection and loading decisions as part of Encarnación’s implementation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the interactive controls add

The Observatory offers Cinematic, Lens, Disk and Shadow views, along with controls for Doppler effects, secondary images and lensing. These controls help a visitor isolate parts of the rendering and explore which features come from the modeled light paths and which come from other rendering choices. The simulator is presented for browsers with WebGL2, with a flat version available when the device cannot manage the scene or the visitor prefers not to start the graphics workload.

Sources

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.