How lepsima/black-hole-simulation works
BlackHoles is an interactive C#/HLSL black-hole renderer. The main workflow starts with user input and camera movement, dispatches a per-pixel compute-shader simulation, applies bloom, and draws the result and menu. A separate video-render mode interpolates between camera positions and saves rendered frames. The README also describes configurable disk and ray-tracing behavior; those simulation details are documented, but the shader implementation was not excerpted. Edges reflect shown calls, source-index references, or README statements.
Main entry points: Core.cs Game coordinator · FrameRenderer.cs Frame renderer · BloomFilter.cs Bloom filter · Camera.cs Camera state
Components 16
Application
- Application entry
Program.cs - Game coordinator
Core/Core.cs - Frame statistics
Systems/FrameStats.cs
Simulation
- Ray simulation
Core/BlackHole.cs - Ray compute shader
Content/BlackHole.fx
Rendering
- Frame renderer
Core/FrameRenderer.cs - Bloom filter
Systems/BloomFilter.cs - Bloom shader
Content/Bloom.fx - Quad renderer
Systems/QuadRenderer.cs - Menu renderer
Systems/TextRenderer.cs - Rendered frame files
Controls and settings
- Camera state
Core/Camera.cs - Keyboard input
Systems/InputHandler.cs - Settings files
Core/Settings.cs - Settings refresh
Systems/Configurable.cs
Other components
- User
Connections 18
- User → Keyboard input: presses keys
- Application entry → Game coordinator: starts game
Program.cs - Game coordinator → Keyboard input: registers handlers
Core/Core.cs - Game coordinator → Camera state: updates
Core/Core.cs - Game coordinator → Frame renderer: draws frames
Core/Core.cs - Game coordinator → Frame statistics: updates stats
Core/Core.cs - Game coordinator → Settings files: loads settings
Core/Core.cs - Game coordinator → Settings refresh: applies settings
Core/Core.cs - Frame renderer → Camera state: reads camera
Core/FrameRenderer.cs - Frame renderer → Ray simulation: renders simulation
Core/FrameRenderer.cs - Ray simulation → Ray compute shader: dispatches compute
Core/BlackHole.cs - Frame renderer → Bloom filter: applies bloom
Core/FrameRenderer.cs - Bloom filter → Bloom shader: loads effect
Systems/BloomFilter.cs - Bloom filter → Quad renderer: renders passes
Systems/BloomFilter.cs - Frame renderer → Menu renderer: draws menu
Core/FrameRenderer.cs - Game coordinator → Menu renderer: loads renderer
Core/Core.cs - Game coordinator → Camera state: updates controls
Core/Core.cs - Frame renderer → Rendered frame files: writes images
Core/FrameRenderer.cs