Former B.Tech student from NIT Nagpur launched an app to explore the gravitational lensing of light near black holes

Black hole

Piyush Shukla is an engineer and a programmer also known as neoned71 has recently launched an app that helps people to explore the gravitational lensing of light near black holes.

The application is a ray marched renderer of a gravitating black hole. It means that the system actually calculates the deviation in the path of the light due to the gravitational force, then finds the body the ray finally lands on, which causes an effect of the refraction of light around the black hole. Things that appear to be somewhere aren’t there because of the curving of the light like a mirage. This visualization is strange at first to a human eye.

Piyush Shukla said that “There are many reasons to choose this project. It required the knowledge of physics and the ability to program it in a graphics pipeline, similar to that of a game engine, but game engines do not let the curving of a light ray according to will. Having built such a system has let me create visuals of various strengths of gravitational fields. The Prime of my research was to visualize a body with a repulsive but strong gravity.”

Just for pedagogical reasons, he wanted to explore the surroundings of a supermassive gravitating body, which happens to bend even light, and upon reaching definite proximity, even light cannot escape and is doomed to fall inside the black hole. Systems and pipelines are in place nowadays to help you render even the most realistic environments with almost perfect light simulation. However, inside that virtual light simulation, light always moves straight. It is safe to say that it is impossible to bend virtual light inside a game engine. The solution lies in the technology called Shaders.

A shader is a program that paints over a plane or a sphere. It is the job of the shader to calculate for every pixel on that plane, by throwing a light ray out, and figuring out where it lands. Where ever it lands, just pick up the colour of that object and set it to the colour of the pixel. Do that for every pixel and you are done with the complete frame. For a game like an environment, this frame is constructed almost 60 times per second.

There is a similar technique for tracing a ray of light, Ray Marching. Light travels straight for some distance, then checks if it has collided with any object in the scene, if not find for how long it can keep going straight without hitting anything. Once a hit is acknowledged, a colour value is picked up from the object and set as the pixel value from where the ray has emerged. Straight-line motion is the only motion allowed.

Furthermore, Mr Shukla stated “There are many reasons to choose this project. It required the knowledge of physics and the ability to program it in a graphics pipeline, similar to that of a game engine, but game engines do not let the curving of a light ray according to will. Having built such a system has let me create visuals of various strengths of gravitational fields. The equation that governs the path of a ray is based on the Newtonian formula for gravity. Now, using that particular formula produced the classical black hole without rotation and charge, but alterations to the formula are the key for new research. Simple modifications, to the formula, created absolutely different visualizations. The Prime of my research was to visualize a body with a repulsive but strong gravity. These bodies may not exist, or definitely not, but it is intriguing to see the effect on space & time as if they exist.

Links to the App:
Play store: https://play.google.com/store/apps/details?id=com.neoned71.shadertoyimport
Source code: https://github.com/neoned71/black_holes_godot.git

About Neel Achary 19363 Articles
Neel Achary is the editor of Business News This Week. He has been covering all the business stories, economy, and corporate stories.