Haskell Ray Tracer


Here I provide some code and some explanations of my very basic implementation of a path tracer. I basically follow the first book of a series on Ray Tracing by Peter Shirley. I am far from proficient in Haskell, so this post should be seen more as some self-study notes. My implementation is far from efficient or idiomatic, but I think that maybe I can get the point across and show an intuitive implementation for other beginners like me. This tutorial is separated into four parts:

Table of Contents

Introduction

The repository

I have uploaded all the source-code to a GitHub repo. There is also a folder (and a branch) containing the code for each section in this tutorial. So, if you want to acess the code at a certain point in the tutorial, just clone the appropriate branch or check the right folder. In the master branch/main folder you can find the final code with more detailed comments.