Project
Galaxy visualization
Simulating and visualizing 100k galaxies with Raylib OpenGL front end.
Highlights
- Visualizes 100,000 real galaxies plus 100,000 random points
- GPU-parallel assignment context: compute 10B pair angles on a GPU
- Performance notes documented in the repo (expected ~3s; optimized to ~0.85s on RX 6900 XT)
Overview
This project visualizes 100,000 real galaxies (blue) and 100,000 randomly distributed points (red). The data and assignment come from the GPU programming course at Åbo Akademi University.

Problem / assignment
The student assignment is to use parallel GPU programming (CUDA or HIP) to compute 10 billion angles between galaxy pairs and demonstrate whether the galaxy distribution is random. Students are expected to run the computation on a small cluster or a single GPU.
Build & prerequisites
The repository provides two build options: a simple build.sh wrapper (uses clang) or Meson (recommended for IDE integration). The visualization depends on Raylib (tested with v5.5-1). Other prerequisites listed in the repo include Git, base development tools (e.g. build-essential), Clang (or GCC), and optionally Meson and gdb.
Meson:
meson setup build --buildtype=release
meson compile -C build
./build/galaxy_visualization_raylib
Bash (build.sh):
chmod +x ./build.sh
./build.sh
./build/galaxy_visualization_raylib
Notes on performance
The expected runtime for the full calculation of roughly 3 seconds, and it is possible to optimize a solution to about 0.85 seconds on a single AMD RX 6900 XT (my test). The repository emphasizes that the program here is the visualization of the data and not the solution to the course assignment.
Data sources
- Earth model: NASA VTAD earth 3D model (credit in repo).
- Redshift data: Huchra redshift catalog (seyfert.dat) (link provided in README).
