• Stars
    star
    4,856
  • Rank 8,233 (Top 0.2 %)
  • Language
    C++
  • Created over 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A brief computer graphics / rendering course

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.

More Repositories

1

tinyrenderer

A brief computer graphics / rendering course
C++
19,058
star
2

tinykaboom

A brief computer graphics / rendering course
C++
2,314
star
3

tinyraycaster

486 lines of C++: old-school FPS in a weekend
C++
1,840
star
4

triador

Ternary computer emulator
C++
220
star
5

glsltuto

GLSL shaders tutorial
C++
213
star
6

least-squares-course

By a programmer for programmers
TeX
181
star
7

hellOGL

Yet another (but better) modern OpenGL hello world
C
81
star
8

tinycompiler

Writing a compiler in a week-end
Python
69
star
9

ultimaille

The ultimate mesh handling library
C
47
star
10

sdl2-demo

sdl2 platformer game blank repository
C++
45
star
11

tutorials

C++
42
star
12

penny

3 servos, 10 dollars hexapod
HTML
30
star
13

stlbfgs

C++ L-BFGS implementation using plain STL
C++
24
star
14

invertible-maps

C++
24
star
15

neato-xv11-lidar

Protocol description and linux implementation
C++
22
star
16

instantangle

2D mesh deformation interactive demo
C
20
star
17

tinyrenderer-java

Just a java implementation of https://github.com/ssloy/tinyrenderer/wiki
Java
15
star
18

QIS

Quasi-isometric stiffening C++ implementation
C++
9
star
19

quadruped

TRIK + dynamixel ax-12a
C++
7
star
20

harlequin

ZX spectrum 48k Harlequin Superfo clone
7
star
21

mathfun

C
6
star
22

winslow2d

Winslow elliptic smoothing for 2d unstructured triangular meshes
C++
6
star
23

ENSG

Support c++ code for lectures on numerical geology
Python
3
star
24

stroll

code example for bachelor programming class
C++
2
star
25

pentominos

L2 programmation avancรฉe support
C++
1
star
26

ternary

triador hardware
C
1
star
27

NuPogodi

C++
1
star
28

ifs

iterated function systems small programs
C++
1
star
29

jfig2020

rendering contest entries
1
star