A brief computer graphics / rendering course
Go to file
Dmitry V. Sokolov 9f16ee86d2
Update Readme.md
2019-01-20 23:01:54 +01:00
.gitignore checkerboard 2019-01-20 12:27:10 +01:00
CMakeLists.txt First commit; rudimentary framebuffer check 2019-01-20 12:13:53 +01:00
geometry.h First commit; rudimentary framebuffer check 2019-01-20 12:13:53 +01:00
out.jpg checkerboard 2019-01-20 12:27:10 +01:00
Readme.md Update Readme.md 2019-01-20 23:01:54 +01:00
tinyraytracer.cpp checkerboard 2019-01-20 12:27:10 +01:00

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 article that accompanies the source code. 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

Homework assignment

homework_assignment branch contains all necessary stuff to easily add environment maps:

... and triangulated meshes:

All boring code (image/obj files serializer etc) is already added; to obtain the above image ot suffices to add 10-20 lines of code.