RepositoryC++
SS

ssloy/tinyraytracer

A brief computer graphics / rendering course

5.4kstars
354forks
13issues
6views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: software-renderer

#1 Repository of the week

2
TINIX TRENDING·Topic: rendering-engine

#2 Repository of the week

2
TINIX TRENDING·Topic: fun

#2 Repository of the week

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.

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
ssloy/tinyrenderer

A brief computer graphics / rendering course

24.6k
Jul 29, 2026
RepositoryC
rswinkle/PortableGL

An implementation of OpenGL 3.x-ish in clean C

1.3k
Oct 30, 2026
RepositoryC++
aseprite/aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)

41.3k
Nov 20, 2026
RepositoryC++
blender/blender

Official mirror of Blender

22.9k
Dec 1, 2026
RepositoryC++
lettier/3d-game-shaders-for-beginners

🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.

20.2k
Jun 25, 2023
RepositoryC++
bkaradzic/bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

17.7k
Nov 27, 2026
RepositoryC++
SFML/SFML

Simple and Fast Multimedia Library

12.1k
Dec 1, 2026
RepositoryC++
AcademySoftwareFoundation/OpenShadingLanguage

Advanced shading language for production GI renderers

2.4k
Nov 27, 2026
RepositoryC++
LiangliangNan/Easy3D

A lightweight, easy-to-use, and efficient library for processing and rendering 3D data (C++ & Python)

1.7k
Nov 30, 2026