A brief computer graphics / rendering course
 
 
 
Go to file
Dmitry V. Sokolov ce6b7852b7 fstream is a proper RAII object 2022-03-18 17:33:28 +01:00
.gitignore checkerboard 2019-01-20 12:27:10 +01:00
.gitpod.yml Added gitpod support 2019-01-22 07:24:00 +00:00
CMakeLists.txt c++17 facelift 2022-02-21 22:12:40 +01:00
Dockerfile Added gitpod support 2019-01-22 07:24:00 +00:00
Readme.md Update Readme.md 2019-02-20 14:00:15 +01:00
anaglyph.jpg anaglyph with envmap 2019-01-30 22:38:58 +01:00
out.jpg checkerboard 2019-01-20 12:27:10 +01:00
tinyraytracer.cpp fstream is a proper RAII object 2022-03-18 17:33:28 +01:00
trace.png An image to better explain the computation of ray directions 2019-01-22 12:47:57 +01:00

Readme.md

Understandable RayTracing in 256 lines of bare C++

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.

Check the wiki that accompanies the source code. The second raytracing chapter is available in the tinykaboom repository. If you are looking for a software rasterizer, check the other part of the lectures.

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:

compilation

git clone https://github.com/ssloy/tinyraytracer.git
cd tinyraytracer
mkdir build
cd build
cmake ..
make

You can open the project in Gitpod, a free online dev evironment for GitHub:

Open in Gitpod

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.