From 0e0365992b5a7f160e6c2eb025470fffb54e8178 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Thu, 10 Oct 2024 12:27:21 +0200 Subject: [PATCH] Update README --- .gitignore | 2 +- Makefile | 6 +++--- README.md | 23 +++++++++++++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0a7ab0f..9b5873c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.exe *.exr ./*.png -path_trace \ No newline at end of file +ray_trace \ No newline at end of file diff --git a/Makefile b/Makefile index c6ad5aa..5968f71 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,10 @@ else endif endif -all: path_trace$(EXT) +all: ray_trace$(EXT) -path_trace$(EXT): Makefile $(wildcard src/*.c src/*.h) +ray_trace$(EXT): Makefile $(wildcard src/*.c src/*.h) gcc -o $@ src/main.c src/utils.c src/camera.c src/mesh.c src/vector.c src/thread.c src/sync.c src/clock.c src/profile.c 3p/glad/src/glad.c -std=c11 $(CFLAGS) $(LDFLAGS) clean: - rm path_trace path_trace.exe + rm ray_trace ray_trace.exe diff --git a/README.md b/README.md index 7ab3c52..f2e6469 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ -This is the implementation of the ray tracing algorithm. Here are some pics: +This is the implementation of the ray tracing algorithm on the CPU ![scene 0](assets/screenshot_0.png) + +# Build +The supported platforms are Windows and Linux. On Linux you need to manually install GLFW 3. After that you can build the program doing + +``` +make +``` + +# Usage +You need to run the renderer from the command line providing it the proper arguments: +``` +./ray_trace.exe --scene scene_0.txt --threads 16 --init-scale 2 +``` +This will open a window with the rendered scene. You can more around with WASD and change the camera direction with the mouse. + +You should use a number of threads equal to the number of CPU cores. The `--init-scale` lowers the initial resolution of the scene when moving the camera and can be any power of two between 1 and 16 (1, 2, 4, 8, 16). + +# Other Pics + ![scene 0](assets/screenshot_1.png) ![scene 1](assets/screenshot_2.png) -![scene 2](assets/screenshot_3.png) \ No newline at end of file +![scene 2](assets/screenshot_3.png)