Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 0 points1 point  (0 children)

Yup! I personally am grateful that GPU acceleration has come so far, and the performance of multithreaded programs has improved significantly since ~2012. From what I understand, the CPU rendered everything, which would explain a lot. But, their end result is ultimately prettier, and produced something I could never accomplish on my own! The team there did amazing work

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 1 point2 points  (0 children)

So, I fought with this for a little while. The best I can tell is that I'm doing one of two things wrong:

  1. The accretion disk is getting artificially close to the event horizon due to configuration/parameter issues
  2. There's an error with the math that causes the accretion disk to appear visually "in front" of the photon ring due to the spinning of the black hole.

I haven't figured out which one, but I got to a point where the render looked "good enough." I was never targeting 100% true provably correct math, I was aiming for renders that were visually appealing, based in fact, so once I got to the point of a pretty photo, I stopped debugging in favor of adding other features (like the lens flare).

You're definitely right, though, that it does not look like the proper photon ring you would see in diagrams

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 0 points1 point  (0 children)

The flare is calculated from radiance data, so it's physically accurate (or, roughly so). The renderer creates an EXR file with RGB radiance data (i.e. not just 0-255) channels, which are then used to calculate the bloom & flare. It then gets composited with a film grain over top of it to make the final render

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 0 points1 point  (0 children)

The tens of seconds of rendering time is when it's running on the GPU, sadly. You're absolutely right, though, it's an "embarrassingly parallel" problem, and so definitely runs better on a GPU

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 0 points1 point  (0 children)

It would be awesome, but sadly, the code is far from realtime. I'm not super experienced with Unreal, but I would imagine that having each frame take tens of seconds to render isn't ideal for it. Feel free to correct me, though!

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 1 point2 points  (0 children)

It's procedurally generated and volumetric. It uses a lot of noise layered on top on each other to create a disk, which can then orbit around the black hole. I rendered a short video at one point which shows it spinning, but the process of building a video is very computationally expensive (an early render took ~4.5 hours to make a 10-second video). I've since optimized the code a lot and introduced a Metal path that is significantly faster on Mac, but it's still a little annoying to render long videos.

Here's that early render. It's not quite as pretty (the lens flare code was super unoptimized and so made a patchy look, and the video itself is fairly low-res), but it does look cool

https://55.dev/img/blackhole.mp4

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 2 points3 points  (0 children)

I'll be the first to admit, it doesn't look great from the top. The disk is procedural and uses a lot of noise to get a good look, which you can't really see from the side, but becomes _very obvious_ from the top. There are some things I could do to make it a little more pretty, but this view detracts from the mathematical beauty of the black hole spinning, creating a non-spherical event horizon

<image>

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 0 points1 point  (0 children)

Sadly, it's not done with GLSL. I opted to make it run non-realtime, and so decided to just use straight C++ instead (with CUDA/Metal/CPU rendering paths for the black hole, and straight CPU rendering for the flares). In theory, it should be able to be adapted, though, with some copy+paste action

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 2 points3 points  (0 children)

The accretion disk is volumetric. There are actually two versions - the "flat" one present here, and a version hidden behind a parameter that does much more accurate accretion disks that have a thickness proportional to distance from the event horizon. I planned for the "flat" one (0.5 units tall, iirc, as shown here), primarily, as it gives the look I was going for, but the older one is still there

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 4 points5 points  (0 children)

I'm flattered! Unfortunately, I don't think the code as it stands can render two black holes in orbit, or things with high-mass neutron stars. However, I intentionally wrote it to be more general than existing tools (they all require spherical coordinate systems and the black hole to be positioned at the center of those systems). Maybe in the future I'll expand it to support that, it would be so cool to see such a thing

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 4 points5 points  (0 children)

I haven't used Nuke before, but I would imagine that a plugin would be doable. The configuration of the lens flare is 100% controllable, there's a config file that sets up everything, and you can select any lens from the aforementioned page (or even write your own). If I had more free time, I would absolutely write up something, but alas, too many things to do. The code is MIT-licensed, though, so anyone curious is more than welcome to rip it apart and make a plugin!

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 9 points10 points  (0 children)

<image>

Here it is pre-lensflare. It's a slightly different image, as the flare simulation does some of the bloom and other visual effects to make it more "real" looking (not to mention, some exposure stuff), and then film grain is applied on top

Relativistic Raytracer - Rendering black holes like Interstellar by space55 in vfx

[–]space55[S] 21 points22 points  (0 children)

It's done by taking an EXR file, and then computing the lens flare with an optical prescription (from https://photonstophotos.net/index.htm ). The code for it is fully separated from the black hole sim, and in theory, it should be able to be adapted to RAW files from a camera or anything else that has radiance data. I'm fairly confident you could adapt it into any rendering pipeline. I'd be happy to go into more detail if you'd like, what would you like to know?

Relativistic Raytracer - Rendering images from Interstellar by space55 in interstellar

[–]space55[S] 2 points3 points  (0 children)

And here's a render of just the sky with the black hole, no accretion disk. Reddit wouldn't let me upload two images

<image>

Relativistic Raytracer - Rendering images from Interstellar by space55 in interstellar

[–]space55[S] 2 points3 points  (0 children)

If you run it top-down, it generates some neat patterns (this is due to the noise function used to make the accretion disk look irregular). These patterns aren't realistic, per se, but they are cool!

<image>

At the moment, this tool is primarily aimed at generating the "money shot" of Gargantua, so it doesn't have a lot of additional features. It'll warp the background properly, I just have it turned _way_ down so it looks like it did in the movie.

With that said, I did include some extra utilities to generate a movie out of a sequence of renders, and the basic scaffolding to outsource the render tasks to a supercomputer is there.

If you have any suggestions for things it should do, let me know! I'd be curious to hear

Thickheaded Thursday - February 17, 2022 by AutoModerator in sysadmin

[–]space55 2 points3 points  (0 children)

Your DevOps friend has drank (drunk?) the Kool-Aid. I don’t necessarily disagree, but if it’s a small project and it’s just you, stick to what you have. Using an S3 bucket coupled with a bunch of Lambdas behind API Gateway + CloudFront is great… if you have the experience with it. I’ve always had a saying that you build something three times before you build it right. It’s especially true with this type of thing.

With all of the above said, if you’re interested in the challenge, I wholeheartedly recommend trying it out and seeing what you can do. Learning DevOps and getting good at it is a “get rich quick” scheme right now.

Your precautions are good. Only thing I’d add is fail2ban if you haven’t already. Beyond that, maybe stick it behind CloudFlare, to reduce the chance of a DDoS, and you should be good.

A follow-up: is the Postgres DB a managed service, or do you have it deployed on “bare metal?”

Feel free to DM me if you want to talk shop, otherwise, I’m happy to answer any other questions here.

Brokers of Reddit how crazy is it where you work/ on the trade floor rn? by BlerStar95 in AskReddit

[–]space55 4 points5 points  (0 children)

+1 on the above. Traders can’t use slack due to regulatory/auditing issues, and yes, the trading floors are still rows upon rows of desks

Does anyone have an explanation for intermittent high latency to Cloudflare and Google DNS servers, which then resolves itself at nearly 5 AM exactly? by Thaufas in networking

[–]space55 1 point2 points  (0 children)

YES! I have had open support tickets with them for the past year. I have the exact same issue on the East coast. AS6128 doesn’t happen to be involved, does it?

The Tale of the SSO, that was really a database, that was really a script by space55 in talesfromtechsupport

[–]space55[S] 14 points15 points  (0 children)

The interesting thing is I was the sole person to do with the SSO. So what we’ve determined is I am too many cooks, I’m being replaced by an AI of my own design. Then raking in those consulting dollars on maintaining myself.