Option 1: Windows (build.bat)
- Ensure MSYS2 UCRT64 is installed at
C:\msys64\ucrt64with SDL2 installed - Navigate to
c-implementation/folder - Run
build.batto compile and launch the raytracer
Option 2: CMake (cross-platform)
- Install CMake (3.16+) and SDL2
- Navigate to
c-implementation/folder - Create a build directory:
mkdir build && cd build cmake .. cmake --build . --config Release ./raytracer # or raytracer.exe on Windows
The raytracer renders a 640×480 scene using Q8.4 fixed-point math and displays it in an SDL2 window.
- Edit
verilator-bench/config.sh:- Set
VERILATOR_SOURCE_FOLDERtoproper-implementation-no-uart - Set
VERILATOR_TOP_MODULEtoraytracer_simple
- Set
- In an MSYS2 UCRT64 terminal, navigate to
verilator-bench/ - Run
bash run.shto build and launch the raytracer in an SDL window - Make sure you have dependencies installed: Verilator, CMake, SDL2, etc.
- go to rayforge.ayannali.net to generate a new scene
- copy this .sv file and place into scene_lut.sv in proper-implementation-no-uart
- re-run verilator-bench to see the new scene in action