• lupsasca 2 hours ago

    Hello! We are Dr. Roman Berens, Prof. Alex Lupsasca, and Trevor Gravely (PhD Candidate) and we are physicists working at Vanderbilt University. We are excited to share Black Hole Vision: https://apps.apple.com/us/app/black-hole-vision/id6737292448.

    Black Hole Vision simulates the gravitational lensing effects of a black hole and applies these effects to the video feeds from an iPhone's cameras. The application implements the lensing equations derived from general relativity (see https://arxiv.org/abs/1910.12881 if you are interested in the details) to create a physically accurate effect.

    The app can either put a black hole in front of the main camera to show your environment as lensed by a black hole, or it can be used in "selfie" mode with the black hole in front of the front-facing camera to show you a lensed version of yourself.

    • lupsasca 2 hours ago

      There are several additional options you can select when using the app. The first lensing option you can select is "Static black hole". In this mode, we simulate a non-rotating (Schwarzschild) black hole. There are two submodes that change the simulated field-of-view (FOV): "Realistic FOV" and "Full FOV". The realistic FOV mode takes into account the finite FOV of the iPhone cameras, leading to a multi-lobed dark patch in the center of the screen. This patch includes both the "black hole shadow" (light rays that end up falling into the black hole) and "blind spots" (directions that lie outside the FOV of both the front-and-rear-facing cameras). The full FOV mode acts as if the cameras have an infinite FOV such that they cover all angles. The result is a single, circular black hole shadow at the center of the screen.

      Next, you can select the "Kerr black hole" mode, which adds rotation (spin) to the black hole. Additionally, you can augment the rotational speed of the black hole (its spin, labeled "a" and given as a percentage of the maximal spin).

      • lupsasca 2 hours ago

        In a nutshell, the app computes a map from texture coordinate to texture coordinate. This map is itself stored as a texture --- to obtain the value of the map on texture coordinates (x,y), one samples the texture at (x,y) and the resulting float4 contains the outputs (x',y') as well as a status code.

        When the user selects the "Static black hole" mode, this texture is computed on the GPU and cached. The "Kerr black hole" textures, however, have been precomputed in Mathematica, due to the need for double precision floating point math, which is not natively available in Apple's Metal shading language.

        The source code, including the Mathematica notebook, can be found here https://github.com/graveltr/BlackHoleVision.

        • lupsasca 2 hours ago

          We hope you enjoy watching the world with Black Hole Vision and welcome any questions or feedback. If you like the app, please share it with your friends!

          The code was written at Vanderbilt University by Trevor Gravely with input from Dr. Roman Berens and Prof. Alex Lupsasca. This project was supported by CAREER award PHY-2340457 and grant AST-2307888 from the National Science Foundation.

          License: This app includes a port of the GNU Scientific Library's (GSL) implementation of Jacobi elliptic functions and the elliptic integrals to Metal. It is licensed under the GNU General Public License v3.0 (GPL-3.0). You can view the full license and obtain a copy of the source code at: https://github.com/graveltr/BlackHoleVision.

          • timthorn 28 minutes ago

            By any chance, was Andrew Strominger involved in this at all? He gave the Andrew Chamblin Memorial Lecture in Cambridge last month and demoed something that looked similar.

            • lupsasca 4 minutes ago

              I think what he showed you was likely a version of this that was coded up by Harvard graduate student Dominic Chang: https://dominic-chang.com/bhi-filter/

              It works very well (and in a browser!) but is limited to a non-rotating (Schwarzschild) black hole---we really wanted to include black hole spin (the Kerr case). As we write on the github, talking with Dominic about his implementation was very useful and we are hoping to get a paper explaining both codes out before the end of the year.

              • lupsasca 7 minutes ago

                Yes, Andy has been very involved in the story of the photon ring and was one of the lead authors on the original paper that started it all: https://www.science.org/doi/10.1126/sciadv.aaz1310

                (And he was also my PhD advisor.)

      • bryant 2 hours ago

        Neat. I'll probably use it for five minutes, appreciate the math that went into it, and move on. But nevertheless, pretty neat.

        I say that because there's an idea to play with for a v1.1 that would give it staying power for me:

        Do you have enough processing power on an iPhone to combine this with Augmented Reality? That is to say: can you explore "pinning" a singularity in a fixed region of space so I can essentially walk around it using the phone?

        Assuming that's possible, you could continue evolving this into a very modest revenue generating app (like 2 bucks per year, see where it goes?) by allowing for people to pin singularities, neutron stars, etc. around their world and selectively sharing those with others who pass by. I'd have fun seeing someone else's pinned singularity next to the Washington monument, for instance. Or generally being able to play with gravity effects on light via AR.

        • isoprophlex 2 hours ago

          Commenting to reinforce this idea: I'd love an AR approach where I can pin a black hole with a given radius into my living room, and walk around it!

          The geosharing augmented reality thing mentioned by the parent comment is very very cool too, I'd pay a few bucks for that! Maybe make it social by letting black holes that people drop somewhere IRL merge, etc...

          Reach out to me if you eventually would like to spin up a cheap bit of infrastructure to host the data of where people dropped their black holes, and need some help with that!

          • lupsasca 2 hours ago

            That's an excellent idea! And indeed, part of the reason we started with the iPhone is because we've been thinking from the get-go about an eventual extension to Apple Vision Pro. As I wrote in my other comment, this is part of an outreach effort to get the public (and students) excited about black hole physics, so we will always keep the code free and open source.

            • deadbabe an hour ago

              That’s exactly what I thought this would be, imagine my disappointment.

            • gigatexal 10 minutes ago

              Instant download for me. I’m a sucker for anything black hole related.

              • lupsasca 2 minutes ago

                Glad to hear that! You'll probably also enjoy reading about the Black Hole Explorer (BHEX): a proposed space mission that will take the sharpest images in the history of astronomy and resolve the "photon ring" of orbiting light around a black hole. https://www.blackholeexplorer.org/

              • consumer451 an hour ago

                First thing I wondered is what would happen if I pointed it another screen, with an image like this loaded. I realize that it's not realistic due to the z-axis, and field of view, but it's pretty fun.

                https://esahubble.org/images/heic0609a/

                • spaceisballer an hour ago

                  Just tried to check it out. First boot it crashed, killed app and tried again and now it won’t open. I’ll try and reinstall and do over. iPhone 16 Pro, iOS 18.1

                  Quick edit- I did exactly that and now it works fine. First boot up before seemed like it got stuck when asking for permission to use the camera.

                  • lupsasca an hour ago

                    Glad it worked on second boot! We used to have some bugs in the elliptic integral implementation that led to the app crashing, but we think we've eliminated those, so hopefully this is just a fluke... Anyone else with this issue?

                  • blululu an hour ago

                    This is awesome. I see that this is GPL and open on GitHub. Thank you for sharing. If you are open to feature requests that I am too lazy and stupid to accomplish on my own, I would appreciate the option to drop the multi camera view and the option to capture a photo. Also plus one to the idea of being able to pin the black hold to a specific orientation so you can see what it looks like to pan around an object adjacent to the black hole.

                    • lupsasca an hour ago

                      Adding options to drop the multi-camera view and to capture a screenshot is relatively straightforward, and I think we can implement that in the next update. Pinning the black hole to a specific place is a whole other undertaking...

                    • lambdadelirium 2 hours ago

                      >physically accurate >event horizon doesn't appear in my room :(

                      • lupsasca 2 hours ago

                        Something to rejoice about, no? ;)

                      • floxy an hour ago

                        Would a person notice red-shifts from the black hole as well?

                        • lupsasca 41 minutes ago

                          Yes, but one issue is that the amount of redshift depends on the motion of the emitter, so we would have to artificially assign some four-velocity to your surroundings in order to give them some redshift. There doesn't seem to be a "natural" choice for how to do this.

                          TLDR: redshift depends not only on the position of the source, but also its velocity.

                        • insamniac an hour ago

                          As above so below. I love how it looks so similar to a colonoscopy.

                          • lupsasca 39 minutes ago

                            There are other apps out there for this kind of black hole vision...

                          • 01HNNWZ0MV43FF 2 hours ago

                            Does it use iPhone-specific features or could it work on, e.g., a desktop

                            • jtbayly 11 minutes ago

                              I was able to install it on my M1 Mac, fwiw.

                              • lupsasca 2 hours ago

                                We wanted the app to work on an iPhone and that required the use of Apple Metal code. This could of course be ported to a desktop but we're not sure there would be much interest in that?

                                • lagrange77 2 hours ago

                                  Maybe WebGPU would be a good porting target.

                                  Really cool app btw!

                                  I have once seen a video of Kip Thorne, explaining that the black hole visual effects of Interstellar were an actual physical simulation. I wouldn't have thought, that it was feasible to run on an iPhone.

                                  • lupsasca 2 hours ago

                                    The black hole simulation that was shown in the movie Interstellar is explained in detail in this paper, freely available on the arXiv: https://arxiv.org/abs/1502.03808

                                    As a physicist with a modest background in computing, I was also surprised by how powerful the iPhone GPU is. It can indeed lens the input from the camera at high resolution and in real time with high FPS.

                                    • lagrange77 an hour ago

                                      Cool, thanks for the reference!

                              • cybenko 2 hours ago

                                What happens with the rotating one and a realistic POV?

                                • graveltr 2 hours ago

                                  It looks needlessly complicated and messy because the visually interesting region when rotation is turned on is blocked out by the FOV cutouts. We felt it was best to only allow the user to select the full FOV in this mode.

                                  Thanks for the question!

                                • Y_Y 2 hours ago

                                  This is not a simulation of a black hole, but rather an image filter that emulates one particular effect.

                                  • lupsasca 2 hours ago

                                    Yes, agreed. We thought it would be fair to call it a "simulation" of what your surroundings would look like if a black hole were within your FOV, but as you say we do not take into account all effects (time delays in particular would require a lot of buffering and we decided this would be impractical to implement, and not that illuminating).

                                    • hnuser123456 2 hours ago

                                      This is still nice when there are so many artistic images of black holes that do not take such care to use known physics to create an accurate image. Well done all. Looking forward to seeing what BHEX sees.

                                    • Y_Y an hour ago

                                      You're right that the time delays and redshifting wouldn't add much to a toy app, but some of us are here for the physics.

                                      Honestly it's not so far-fetched (to me) that in a few years someone will have GRRMHD simulations running in real time on a portable device.

                                      Are you familiar with A Slower Speed of Light? It's a game which has some nice special-relativistic effects.

                                      http://gamelab.mit.edu/games/a-slower-speed-of-light/

                                      • lupsasca an hour ago

                                        Yes, such a great game---it's a fantastic visualization of special relativity and also fun to play!

                                        I think we're still a ways off from real time GRMHD sims, but CK Chan from UArizona had a working VR simulation (on the Oculus iirc, but now deprecated) that allowed you to explore a pre-existing GRMHD simulation in real time and in 3D. I think he might be working on a new version of this.

                                  • xqcgrek2 an hour ago

                                    As always, wonder what a particular "free" thing is selling and to whom. In this case it's something called BHEX, to NASA.

                                    • lupsasca an hour ago

                                      As Project Scientist for BHEX, I am of course excited about the project and eager to spread the word about it! But as I wrote in my other comment, what this is really trying to "sell" is gravitational physics to students interested in black holes, and this effort is supported in part by the National Science Foundation.

                                    • mock-possum 2 hours ago

                                      Does anyone else find it jarring to unexpectedly be shown the selfie camera view? Showing both camera feed thumbnails constantly while using this app is a little odd.

                                      Still, kinda fun, reminds me of playing around with different blur / liquidify filters in photoshop back in the day.

                                      • graveltr an hour ago

                                        Good point. In a future update, we can add a button to show / hide the camera views.

                                      • bossyTeacher 42 minutes ago

                                        Pendatic but can I ask why does this app require 17.5 or later? For reference, the latest iOs version is 18. What specific API is being used to require that version?

                                        • graveltr 31 minutes ago

                                          Good point, the minimum version should be an earlier version of iOS, we don’t use any APIs that are only available in 17.5 or later.

                                          Thanks for pointing that out.