BlackH01e

BlackH01e


People: Gavin Zimmerman
Timeline: May 2022
Focus: Tech Art Animation / Realtime
Tech: Blender 3.1
Link: N/A

Table of Contents

BlackH01e



Background

This project was completed as part of a final for the "Black Holes" course at University of Colorado, Boulder taught by Professor Ann-Marie Madigan. This simulation was created to illustrate the effects of gravitational lensing and how accretion disks behave around a black hole. As a project for communicating characteristics of black holes and the science behind them, I've attached a brief blurb about black holes and the gravitational lensing effect:


Black holes are incredible cosmic objects of various immense sizes scattered throughout the universe. These bodies are so massive and dense that the gravitational pull they exert even bends light. Below whats known as the 'event horizon', light itself is not able to escape due to the immense gravity - which is why black holes appear black. Beyond the horizon, gravity is less, but still very powerful and bends light rays around the hole producing a lensing effect.

From our perspective the area immediately surrounding the black hole has the most significant distortion bent along the curvature of its surface. By this effect, we are actually capable of seeing what is behind the black hole. For example, the accretion disk is completely visible although part of it would normally be occluded by the black hole. These accretion disks are also interesting objects, made of highly energetic gas (plasma) and spin like rings around the black hole. The scale of these disks is variable and not every black hole may have one. However when they do exist, black holes are easy to identify in space (with a event horizon telescope the size of Earth). The lensing effect can also be utilized to identify these bodies, since the way in which black holes bend light will double the luminosity of stars behind them.

Breakdown

I've attached a breakdown here for anyone else looking to create their own supermassive black hole effect.

Black Hole

The first part of this breakdown covers the black hole object itself, which is a bit harder than modelling a black 3D sphere. This object should create seemingly accurate light bending effects, as well as be very very dark in the middle.

I've seen a few approaches to this by other Blender artists, a classmate, a guest lecturer, and an unreal developer. Needless to say many people enjoy black hole 3D projects. Most of these approaches all employed ray-tracing techniques, usually by adjusting the direction or velocity of the light ray in small increments. This is also the approach to dynamic and chaotic systems, which may use Runge-Kutta techniques for extremely precise calculations. Depending on the platform technology this may involve coding your own tools to some degree.

Blender is capable of bending light rays multiple times, provided that cycles is the selected rendering engine. However for my approach I wanted the black hole to be realtime performant and use Blender's realtime engine 'Eevee', where light can only be bent or refracted once. So to recreate the gravitational lensing effect, light could not curve around the hole but would need to be bent towards the final location.

So that 3D objects in the scene could also appear distorted, Screen Space refractions were enabled.

1

2



  1. SSR enabled in Rendering options
  2. SSR enabled in Material options
  3. Light refracting through glass
To perform light bending in Eevee, a Refraction BSDF shader is used to perform the necessary ray-tracing bounce internally. For context, when light passes through an object it refracts and is bent near/away from the normal depending on the index of refraction ratio between the mediums the light travels through.

3



Any 3D geometry can be used with the refraction shader. Planes combined with this shader are useful for post-processing filters in some use cases. For this case, a sphere is used since it looks the same from every angle and black hole's are already sphere like.

4



  1. Geometry of black hole effect
Unfortunately, the normals on the sphere don't initially line up to bend light in the desired direction. Normals on the edges face away from the viewing angle and cause light to bend a lot - where they should instead bend only a little. Likewise, the normal in the center is parallel with the viewing angle and barely causes light to bend.

To fix this, the normals need to be recalculated so that they bend light inwards. If the Index of Refraction is less than 1, that would roughly look like:

5

6



  1. Desired light bending effect
  2. Normal derivation for light bending effect
This was done by rotating the existing normals 90 degrees inwards towards the center of the sphere. The rotation performed uses the axis-angle method where the axis is the cross product of the incoming vector (camera forward vector) and existing normal.

7

8



  1. Rotation logic node setup
  2. Black hole visual of 7
Next, a dot product on the incoming vector and initial normal is used to obtain a factor for controlling the IOR parameter. The dot product is passed through an arccosine operation and remapping from [0,pi/2] to [0,1]; this obtains the angle of the vector and maps [0,90] degrees to [0,1]. With this normalized value, a float curve then controls the index of refraction value. With this dynamic IOR, you can see how the distortion or bending is much smoother. This is especially the case when the refraction precision is bumped up higher than shown here.

9

10



  1. IOR calculation node setup
  2. Black hole visual of 8
Finally, the center is colored dark so that the black hole has a black hole. For useful units, the angle obtained above is passed into an arctan function which now gives a ratio in the range of [0,1]. 0 = center of sphere; 1 = edge of sphere. This controls the ratio of the black hole to the entire geometry.

11

12



  1. Full node setup
  2. Final black hole visual

Accretion Disk

The accretion disk is made from a procedurally generated texture. For making this effect, the initial geometric space is rotated around the center of the disk. The new rotated space can then be plugged into a noise function to generate the clouds.

1

2

3



4



  1. Starting Geometric Space
  2. Rotated Space
  3. Generated Noise
  4. Node Setup
The scene time is added onto the rotation angle which animates the disk spinning. However with this setup, the disk is spinning uniformly. Instead the desired (and physically accurate) effect is to spin fast at the center and slow at the edges. This is done by chopping the disk up into multiple rings like a tree trunk. How fast the ring spun would then depend on how far it was from the center.

5

6

7



8



  1. Disk segments
  2. Factor determining place between center and edge
  3. New rotated space
  4. Node network
Unfortunately when the space is discretized like this, the clouds look choppy and when the disks are split become apparent. However, the space could not be continuous and rotate at different speeds or else it would become stretched over time (like a rubber band twisted).

9



  1. Visible cuts in the noise
The fix? Blending.

A fairly simple method of blending is allowing multiple rings to overlap. This can be done in many ways. Here the disk is cut into 5 and 8 rings, with a small gradient added to the edges of the rings for a softer taper. The rings can't be too thin or the cloud clumps would become too thin, but I imagine offsetting and layering many ring setups could make an amazing visual.

10



  1. Visible cuts in the noise
Finally, color is added.

I find that simple shapes pair well with simple color schemes, so for this project I choose to push the color contrast as far as it could go with two colors: red and black. Here, less is more. By omitting many colors, a contrast between the accretion disk and black hole is obtained while emphasizing shape and form.

11

12

13



  1. Colored noise w/o taper
  2. Colored noise w/ taper
  3. Node setup
  4. Noise applied to center
Some extra value is added onto the noise at the end of the disk edges. This results in a smooth taper on the edges when passed through the comparison operation deciding if a fragment is visible or not.

To complete the look, noise is added onto the center of the disk to shake it around. This was to add a violent feel at the center where everything is moving at incredible speeds.

14



Additional Resources

A space background is always good for these types of projects. I found a great milky way panorama here, which can be used as an HDRI.