Black Hole Distributed Raymarcher

Black Hole Distributed Raymarcher

by GCgamesandcartoons

👁 428 ❤️ 26 ⭐ 17 🔄 1
Created: Jun 26, 2022 Last modified: Jul 2, 2022 Shared: Jun 26, 2022

Description

https://turbowarp.org/709319751?turbo&stuck UPDATES ON PREVIOUS: - Accretion disk - Reflective sphere - Antialiasing HOW THIS WORKS: This is based on the formula F=G*(m1*m2)/r^2, where r is the distance between two objects, G is gravity, m1 and m2 are the object masses, and F is the force of attraction between them. This casts rays from the camera (mass of 1), and some are warped towards and sucked into the black hole, whereas some make it past. Those that make it past form a grid, to demonstrate the warping of spacetime. So, for the ray direction, I made a velocity vector, by creating a new point in the desired direction 'pointing' towards it, then normalising the vector. For every iteration, the photon moves by velocity amount, then the force is calculated with the above formula, and the vector from the photon position to the black hole, rather than the target point, is multiplied by the force of attraction. That is added to the velocity vector, it is normalised again, and it repeats from there.

Instructions

Press the flag and wait. This utilises monte-carlo multisampling. The sphere's reflection looks off because light behaves strangely here.

Project Details

Visibility
Visible
Comments
Enabled