From d7c1ced08d5d78fcb239550404db4e67d4357a19 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 22 Sep 2026 06:57:16 +0200 Subject: fix: windows support --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2c865f2..e3f1f59 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,28 @@ the curvature of spacetime changes the direction of each ray as it passes around ## rendering for each pixel, donut generates a ray from the camera using its position, orientation, field of view, and aspect ratio. the ray is then converted into the coordinates used by the geodesic integrator and propagated through the scene. during integration, the renderer checks for intersections with the black hole, accretion disk, and other scene objects. rays that escape are sampled against the background environment. the accretion disk is a thin, opaque, self-luminous surface in the equatorial plane, with a novikov–thorne temperature profile that is hottest just outside the inner edge and cools outward, coloured as a redshifted blackbody; an optional turbulence overlay modulates its brightness. its gas orbits at relativistic keplerian speed (reaching half the speed of light at the innermost stable orbit), so the disk is doppler-brightened on the side rotating toward the camera. since the disk is viewed through curved spacetime, different parts of it can reach the camera along multiple paths around the black hole. the resulting image includes gravitational lensing, gravitational redshift, and doppler shifting from the rotating disk. the final pixel color is determined from the ray's path, its intersection with the scene, and the relativistic effects accumulated along the way. the entire process runs on the gpu as a full-screen fragment shader, tracing every pixel's ray in parallel. +## building +the libraries in `ext/` are git submodules, so clone with `--recursive` (or run `git submodule update --init` in an existing clone). the shaders are prebuilt in `assets/shaders/generated/` and committed, so a plain build doesn't need the slang toolchain. + +**macos (apple silicon)** + +```bash +brew install premake molten-vk vulkan-loader vulkan-headers spirv-cross +tools/fetch-slang.sh +premake5 gmake && make config=debug donut +./bin/debug-macosx/donut +``` + +on macos `make` also regenerates the shaders from `assets/shaders/*.slang`, which is why it wants slang and spirv-cross. + +**windows (x64, visual studio 2022)** + +1. install the [lunarg vulkan sdk](https://vulkan.lunarg.com/sdk/home). its installer sets `VULKAN_SDK`, which the build reads, so open a fresh terminal afterwards. without the sdk the build still works, it just leaves the vulkan backend out and runs on opengl. +2. run `premake5 vs2022` from the repository root ([premake](https://premake.github.io/) is a single exe). +3. open `donut.sln`, pick `debug` and `x64`, and build. f5 runs the app from the repository root; the exe also finds `assets/` on its own when launched from `bin\debug-windows\`. + +**picking a backend.** `config/settings.toml` is created on first run, and `render_api = "OpenGL"` or `"Vulkan"` picks the backend (also under settings → renderer, applied on restart). if vulkan can't start on a machine, donut falls back to opengl and says why in `logs/donut.log`. + ## documentation for a deeper explanation of how donut works, see the [`docs/`](docs/) folder: - [docs/physics.md](docs/physics.md) — the physics and mathematics: null geodesics and the equations of motion, the numerical integrator, the event horizon / photon sphere / isco, the novikov–thorne accretion disk, gravitational + doppler redshift and relativistic beaming, and the observable quantities the renderer can measure. -- cgit v1.3