A simple raytracer in exactly 450 lines of C code.
Find a file
2020-11-20 01:44:09 +13:00
output.bmp Initial Commit 2020-11-20 01:44:09 +13:00
README.md Initial Commit 2020-11-20 01:44:09 +13:00
stb_image_write.h Initial Commit 2020-11-20 01:44:09 +13:00
tinyray.c Initial Commit 2020-11-20 01:44:09 +13:00

tinyray

A simple raytracer in exactly 450 lines of C

Output

Features

  • Sphere-Ray Intersection
  • Materials
  • Diffuse and Specular Lighting
  • Point, Directional, and Ambient Lights
  • Custom Floating-Point Vector Library
  • Output to image with stb_image
  • Gradient Background
  • Watermark

Helpful Resources

I created this toy raytracer to learn about basic raytracing (and for fun, of course), taking inspiration from the following resources:

The first link is especially helpful in understanding how raytracing works from a mathematical perspective.

I created this for fun for the UoA ENGGEN 131 Art Challenge