A C++ Mandelbrot renderer built as a small distributed system.
The project has two executables:
server: opens an SDL window, creates render jobs, and collects computed pixels.client: requests jobs from the server, computes Mandelbrot pixels, and sends results back.
This project demonstrates:
- fractal rendering (Mandelbrot set)
- parallel/distributed work over UDP
- basic real-time visualization with SDL
It is a practical combination of math, networking, and systems programming in modern C++.
- Distributed rendering with multiple clients
- Interactive camera movement and zoom
- Adjustable iteration depth
- Optional anti-aliasing toggle
- CMake-based build workflow
The renderer uses a job-based flow:
- The server splits the image into horizontal chunks
- Clients ask for work via UDP
- Clients compute pixel colors for their chunk
- Clients send finished pixels back to the server
- The server updates the SDL surface incrementally
For a complete deep dive (German), see:
docs/README.md(documentation index)docs/DEEP_DIVE_DE.md(architecture, data flow, thread model, Mandelbrot math, code mapping)docs/PROTOKOLL_DE.md(exact UDP packet layouts and protocol behavior)docs/CODE_MAP_DE.md(function-by-function reference of the codebase)
- C++14
- Boost.Asio (UDP networking)
- SDL 1.2 API (
sdl12-compaton Arch Linux) - CMake + Make
Arch Linux:
sudo pacman -S --needed base-devel cmake boost sdl12-compatUbuntu/Debian (equivalent packages):
sudo apt update
sudo apt install -y build-essential cmake libboost-all-dev libsdl1.2-devRecommended:
make buildAlternative with presets:
cmake --preset debug
cmake --build --preset debug -jStart the server first:
make run-server WIDTH=1280 HEIGHT=720 PORT=5000Start one or more clients in separate terminals:
make run-client HOST=127.0.0.1 PORT=5000Direct binary execution:
./build/debug/server 1280 720 5000
./build/debug/client 127.0.0.1 5000- Arrow keys: move viewport
PageUporm: zoom inPageDownorp: zoom out+: increase max iterations-: decrease max iterationsReturnorq: toggle anti-aliasingEsc: exit
src/server/server entry point and UDP server implementationsrc/client/client entry point and UDP client implementationinclude/shared/shared networking/buffer definitionsinclude/server/server headersinclude/client/client headersCMakeLists.txtbuild targetsMakefileconvenience commands
cmake: command not found
Install CMake using your package manager.- SDL not found on Arch
Installsdl12-compat. - Client appears idle
Ensure the server is already running andHOST/PORTmatch.
- UDP is unreliable by design (packet loss is possible).
- No authentication/encryption in network communication.
- Rendering protocol is simple and intended for local/trusted environments.
