Table of Contents
Built for Siege Week 10, for the 'Space' theme. As space as it gets, right? This one was so much more shader than I expected, and yet I want to try and expose a bunch of shader parameters. Unless someone shows me an easy way to give someone access to a number with godot UI though, I'll just stick with nothing for now. sigh Oh well. I could make this bigger or add this in somewhere or make this my wallpaper though... Wait... If I optimize this?? Someone please help that would be awesome.
A black hole simulation to rival Interstellar!!! No, its a realtime black hole raytracer with an accretion disk, a star, and a grid to show the bending of spacetime. May your computer live to see another day.
- Left click to drag camera around black hole
- Scroll to zoom around the black hole
- Edit the parameters of the shader by yourself! Click and drag or edit the values directly
Math. Physics. Fragment shaders. I hate that I had to have such long conversations with ai to understand any of this... But I mostly understand it now?? Also how to work with fragment shaders! Fun! Also, I finally made a simulation editor, which makes making simulators much easier... :)
Might be big, so click to reveal!
Tip
Scroll! Look around! Have fun! Change the values!!!
If you still insist on building this unoptimized mess, go ahead. Oh, but the release version is here
- Install Godot 4.5
- Download and unzip the code
- Open the file with Godot project manager
- Go to Project > Export, add whichever platform you're on (MacOS, Windows) and then click export.rt.
- You're good to go!
- Left click and drag to pan camera around the black hole
- Scroll to zoom closer and farther
- Simulate the black hole
- Raytracing?
- Render accretion disk
- Stars in the background
- Spherical star to show gravitaitonal lensing
- Simulation interactivity, time step, pause, etc
- Post processing (bloom etc)
- Put a grid under it to show a point of non-moving
- Make it interactible, move the camera around using mouse position
- Edit the simulation yourself using the access to the simulator
A few of the editor values don't work. Maybe will fix later, but the big star follows the black hole position, the camera fov doesn't change anything, and all of the smaller star stuff doesn't work as of now. Sorry...
Distributed under the MIT License. See LICENSE for more information.
Pixel Saver - itch.io
Project Link: https://github.com/PixelSaver/PlacePixels
- Many thanks for both the inspiration and the code from @kavan010's amazing black hole C++ simulation. Couldn't have done it without you.
- https://godotshaders.com/shader/black-hole-shader/ by TheOxideGamer