28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
A raytracer that will render to any ANSI terminal with support for 24-bit
|
|
colours, at least 80x24 big.
|
|
|
|
Build with `make' and run the resulting binary in `/bin'.
|
|
|
|
The raytracer implements the following:
|
|
- Planes, spheres, and point lights
|
|
- Reflection
|
|
- IOR-based refraction
|
|
- Cook-Torrance BRDF (a few other models are left in the code)
|
|
- Primitive object materials
|
|
|
|
You can move around with WASD and SPC/Z; zoom with I/O, change the exposure with
|
|
+/-, and quit with Q.
|
|
|
|
The image output is a 24-bit coloured 80x24 (by default, tweakable in
|
|
`main.cpp'), 2x supersampled. The output uses Unicode characters and differently
|
|
coloured foreground and background to effectively double the output resolution.
|
|
You can read the implementation in `buffer.cpp'.
|
|
|
|
The raytracing loop is parallelised using an OpenMP pragma, which should be well
|
|
supported on most systems. You can just comment out the pragma (and remove the
|
|
omp flag from the Makefile) to remove parallelisation.
|
|
|
|
Although the code isn't particularly documented, most functions have a docstring
|
|
in their respective header files. Most fun things to play around with are
|
|
located in `main.cpp'.
|