tinyraytracer/Readme.md

26 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2019-01-21 06:01:54 +08:00
# Understandable RayTracing in 256 lines of bare C++
2019-01-20 20:48:50 +08:00
2019-01-21 03:59:40 +08:00
This repository is a support code for my computer graphics lectures. It is not meant to be the ultimate rendering code or even physically realistic. It is meant to be **simple**. This project is distributed under the [DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE](https://en.wikipedia.org/wiki/WTFPL).
2019-01-20 20:48:50 +08:00
2019-01-28 05:01:49 +08:00
**Check [the wiki](https://github.com/ssloy/tinyraytracer/wiki) that accompanies the source code. The second raytracing chapter is available [in the tinykaboom repository](https://github.com/ssloy/tinykaboom/wiki). If you are looking for a software rasterizer, check the [other part of the lectures](https://github.com/ssloy/tinyrenderer/wiki).**
2019-01-20 20:48:50 +08:00
2019-01-22 15:24:00 +08:00
In my lectures I tend to avoid third party libraries as long as it is reasonable, because it forces to understand what is happening under the hood. So, the raytracing 256 lines of plain C++ give us this result:
2019-01-20 20:48:50 +08:00
![](https://raw.githubusercontent.com/ssloy/tinyraytracer/master/out.jpg)
## compilation
```sh
2019-01-22 15:24:00 +08:00
git clone https://github.com/ssloy/tinyraytracer.git
cd tinyraytracer
mkdir build
cd build
cmake ..
make
```
2019-01-22 15:24:00 +08:00
You can open the project in Gitpod, a free online dev evironment for GitHub:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ssloy/tinyraytracer)
On open, the editor will compile & run the program as well as open the resulting image in the editor's preview.
Just change the code in the editor and rerun the script (use the terminal's history) to see updated images.