This is a basic raytracer written from scratch in C++. It is designed to be cross-platform. Despite its simplicity, this raytracer can produce basic images with reflections and shading.
- Basic raytracing capabilities
- Scene confiugration using
Lua
- Phong Lighting
- Shadow
- Reflections
- Sphere
- Get the code
git clone https://github.com/CatB1t/raytracer.git
- Clone
Lua
source code into the directoryvendor/lua/
- In the project directory, run
premake5 [action]
, e.g.premake vs2022
- For toolsets like Visual Studio, you can simply load the generated solution IDE and build as you normally would
- If you have generated makefiles, run
make
- You will find the executable in the
build/bin/
directory, if you have a scene config, simply run./raytracer
- To generate a scene configuration file, use
./raytracer -g scene.lua
-w
to specify width. default800
-h
to specify height. default800
-o
to specify output file. defaultimage
-c
to specify scene configuration file, defaultscene.lua
-g name.lua
to generate example scene configuration toname.lua