Summary Files Commits Branches @commit @diff @stats
path: root / src / blog
diff options
context:
space:
mode:
Commitbe9b4ce5c12d140f656c28389d1913f240aa781b (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-02-15 18:52:04 +0200
Committer
 Syndamia <kamen@syndamia.com>
2024-02-15 18:52:04 +0200
Files28ebadcf042d346e9864833157f3c00309c61466 /src/blog
syndamia.com-be9b4ce5c12d140f656c28389d1913f240aa781b.tar
syndamia.com-be9b4ce5c12d140f656c28389d1913f240aa781b.tar.gz
syndamia.com-be9b4ce5c12d140f656c28389d1913f240aa781b.zip
Parent29090187820c880e3f712a18d66482c4a7fd9ff5 (diff)
(blog/bhs) Rewording and simplifications
1 files changed, 45 insertions, 31 deletions
-rw-r--r--src/blog/difficulties-of-making-a-black-hole-shader/index.md76
diff --git a/src/blog/difficulties-of-making-a-black-hole-shader/index.md b/src/blog/difficulties-of-making-a-black-hole-shader/index.md
index 70c711e..555744a 100644
--- a/src/blog/difficulties-of-making-a-black-hole-shader/index.md
+++ b/src/blog/difficulties-of-making-a-black-hole-shader/index.md
@@ -21,7 +21,7 @@ I chose to create an interractive and animated black hole demo.
The primary idea was to show how the gravitational pull of black holes "bends" light and how the result looks from different points of view.
During development I found a lot of hurdles, primarily with the actual mathematics behind it.
-Information online is difficult to find and understand if you don't have a physics background, so I'll try my best to lay out everything I know.
+Information online is difficult to find and understand without having a physics background, so I'll try my best to lay out everything I know.
I'll assume you don't know much about physics, but are familiar with mathematics and at the very least vectors.
@@ -68,8 +68,8 @@ You would get a DOM object in which the graphics will be rendered, and a "contex
## Theoretical and algorithmic background
-&&important I haven't formally studied physics, so you must read with scepticism in mind.
- There are most definetly errors, steming from my lackluster understanding of the subject.
+&&important I haven't formally studied physics, so don't fully trust anything here.
+ There are most definetly errors, steming from my lackluster understanding.
Using [Einstein's field equations](TODO), or to simplify our life, [Schwarzschild's metric](TODO), we can precisely calculate the curvatures in space(time) at every point around a Schwarzschild black hole.
Unfortunetly, the computation would still be too laborious, so we'll need to make an approximation using [celestial mechanics](TODO).
@@ -78,58 +78,72 @@ That is the overall gist of the underlying physics, but I promised an explanatio
### What is a black hole
-First, imagine atoms like marbles on a table.
+Before we even begin to talk about gravity and light, we need to understand how atoms work.
+Imagine a set of marbles, scattered on a table.
![](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Marbles_from_Indonesia.jpg/1280px-Marbles_from_Indonesia.jpg)
*Image from By Okkisafire on [Wikipedia](https://commons.wikimedia.org/w/index.php?curid=30338734)*
-Now, take those marbles and start pushing on them from all sides.
-In the beginning, when they are all faraways apart, it won't be very hard, since you only have to move them.
-After they are touching each other, you'll find that your push doesn't do anything, the glass will keep the marbles together and just "deal" with your force, until a certain threshold.
-When reached, the glass will break, turning the marbles into shards.
+Now, start pushing on all of them from the edges of the table to it's center.
+In the beginning, you'll mostly roll them, until they all get in contact with each other.
+At that point (assuming they all stay flat on the table), the glass will keep the marbles together, handling your force.
-A similar occurence can happen with atoms.
-Ignoring what happens to the orbiting electrons, by pushing atoms together, you reach a certain point where all of the nuclei are "touching".
-Then, the [nuclear force](https://en.wikipedia.org/wiki/Nuclear_force) will try and keep those nuclei together, but if you push hard enough, then you can overcome it, and "shatter" the nucleus into it's subatomic particles.
+By increasing the force with which you push on them, after a certain threshold, the glass will break, turning the marbles into shards.
+Those shards will still have some fight in them, so after increasing your force by another level, you'll turn all of those shards into tiny glass granules.
-But in the same way you can continue compressing the shards until they break and turn into glass granules, you can continue compressing those subatomic particles.
-At a certain point, what breaks, is physics.
-After that certain threshold all atomic and "subatomic" "forces" will be overcame and nothing will be able to hold matter "together"[^matter-together].
+A similar occurence happens with atoms.
+Normally atoms are spread apart, by pushing them together, at a certain point (ignoring the orbitin electrons) all nuclei will be "touching" and the [nuclar force](TODO) will keep them together.
+By increasing your pushing force you can overwhelm the nuclear force and "shatter" the nuclei into their subatomic particles.
-The result is a "collapse", all of that matter just "deflates" into a single, infinetly small point.
-That's called a **black hole** (keep in mind that this infinitessimal point has the same initial mass as the object which collapsed).
-It doesn't affect many stuff in the universe, but the effect on gravity is the most special one.
+Assuming an enormus explosion doesn't happen, and you can keep increasing your force, it's also possible to overwhelm the "subatomic forces" that keep those subatomic particles "together"[^matter-together].
+However, those subatomic particles are more commonly referred to as [elementary particles](https://en.wikipedia.org/wiki/Elementary_particle), meaning there are no "granules" into which the elementary particles can break down.
+It doesn't make sense if subatomic particles wouldn't be "breakable", since that would require dealing with potentially infinite amounts of force and such an assumption would destroy all of humanity's physics.
+
+Then that leaves us with only one solution: laws of matter break.
+If nothing can keep the elementary particles "together", so keep matter "together", then the result is a sort of "collapse", all of that matter just "deflates" into a single, infinetly small point (but the amount of mass isn't infinite, it's the sum of mass from the particles that collapsed).
+That point is called a **black hole**.
+
+This object is very bizzare, generally it doesn't have too much properties, but the ones it has are really unique.
+In my case of computer graphics, the only important part is it's effect on light.
### Geodesics, gravity and gravitational lensing
-Think of a flat surface, like a table or a (flat) sheet of paper.
+To understand how black holes affect light, we first need to understand how black holes affect gravity.
+
+Think of a flat surface, like a table.
What is the shortest distance between two points?
Obviously, that's a straight line segment.
If you then extend that segment, so it has an infinite length, it becomes a line.
However, what if our surface isn't flat?
Imagine two points on a sphere, what is the shortest distance between them?
-You might be inclined to say that's also a "straight" line, but it really isn't: it's an arc of a circle.
+Obviously, it's an arc of a circle and extending it to it's maximum possible length, we get a [great circle](https://en.wikipedia.org/wiki/Great_circle).
![](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Illustration_of_great-circle_distance.svg/480px-Illustration_of_great-circle_distance.svg.png)
*Image by CheCheDaWaff on [Wikipedia](https://commons.wikimedia.org/w/index.php?curid=48187293)*
-This circle is called a [great circle](https://en.wikipedia.org/wiki/Great_circle).
-The main problem with calling this arc a "spherical line segment" (and the great circle a "spherical line" or something similar) is that both objects have different properties.
+Now, what does it mean to go "forwards"?
+On a flat surface, we can define it as "following a (straight) line segment", on our sphere we can say "following an arc of a great circle".
+But what we really need is a more generalized definition, which handles both of our cases (and more).
+
+That's why in geometry there is the notion of [geodesics](TODO), the generalized curve on any surface which (roughly speaking) is the shortest[^geodesics-are-local] path between any two points.
+On a flat surface, that's the line segment, on the sphere it's the great circle arc.
+It's important to note that a general geodesic cannot have most properties you might be used to from "the shortest path between two points".
+For example, on a flat surface, we can have parallel lines, but on our sphere, great circles will always intersect[^parallels-of-latitude].
+
+And there are a lot more complicated surfaces, imagine a flat surface but with half-spherical "trophs" in it, on the flat segments your geodesic would be the line segment, but on those trophs it will be an arc (of a great circle).
+Actually, you don't need to imagine: the entire universe is a 3D surface, which is mostly flat, but has sherical-ish "trophs" in it.
+
+That's one of the primary results from the General theory of relativity, normally the universe's surface is nice and flat, but objects with mass "produce" gravity, which some sort of a force[^gravity-isnt-a-force] that bends our surface and creates those trophs, changing the local geodesics.
+The resultant effect is that if you travel perfectly forwards in a spaceship and pass by an object with mass (like a planet) from a close enough distance, your path will be curved, without you steering your ship.
-Looking at all possible great circles, we find that their center (and radius) matches with the center (and radius) of the sphere.
-From this we can extrapolate that lines can be parallel, but great circles cannot.
-A line is an extended segment, so if you extend two different arcs (which are the shortest distance between two pairs of points on the sphere) and get the great circles, those will always intersect[^parallels-of-latitude].
+Here comes the meat of this section: if you have no outside references (if all planets and stars are invisible), you, in your ship, *wouldn't* really be able to tell your path is curved.
+But to a (stationary) outside observer, like another spaceship, it *would* look like you've turned.
+In fact, while "turning" it will look like you've slowed down, since an arc is always longer than a straight line segment, but you're travelling at the same speed.
-Therefore, the general term for the shortest path between two points on a non-flat surface is (kind of) called a geodesic[^geodesics-are-local] (the arc on the sphere is a geodesic).
-We can now also define what it means to "go straight forwards": in flat surfaces we would say that means following a straight line, while on non-flat it means following a geodesic.
+For the cherry on top, light is also affected by gravity, and we know it's speed is constant and always travels forwards, therefore gravity "bends" light.
-Going back to physics, what the General theory of relativity tells us is that objects with mass bend the physical space, or 3D surface, of the universe, and we call that gravity.
-As a result, the geodesics too are curved, so even though you may be always moving forwards at the same speed, to an outside observer it will look like you turn and change speed.
-The explanation for modified speed is simpler: since we are travelling at the same speed, from the point of view of an outside observer, it should take the same amount of time to go between points P and Q, regardless of gravity.
-However, a normal straight line segment through the points is always shorter than the gravitationally-induced circular arc, meaning it will look like you are travelling a greater distance.
-The only way to balance everything out, is to travel faster.
The amount by which and the size of the area which is affected depend on that object's mass and size.
Generally, if two objects have the same mass, the bigger one will affect a larger portion of space, but will bend it less, compared to the smaller one, which will affect a smaller portion, which will be bend a lot.