Benny Kramek

hrayt, Haskell Raytracer

Introduction

After reading about it for quite a while, I finally decided to start doing some programming in it. Haskell, the pure functional programming language, is really cool.

I was able to get this raytracer working in only a few hours. It's my first raytracer I've written, and it's my first Haskell program I've written. The code is amazingly short compared to what you'd expect from other popular languages, and it's very clean and clear. Coding it was very easy, It was mostly writing the relevant equations in "Haskell format", and it was very pleasant not having to go into that imperative programming mindset where you have to think about lots of variables and loops and track what's going on with them in your head.

I'd like to thank Cale and the other people from the haskell freenode channel for helping me out with this.

Features

  • Supports Spheres(I'll add some more shapes in the future)
  • Uses High Dynamic Range Colors for everything, so you can do nice lighting
  • Flexible shader system, New shaders can be added as haskell functions. Currently there are shaders for doing diffuse lighting with shadows and reflections. Shaders can be easily combined in various ways thanks to Haskell's functional features
  • Uses SDL for showing the render as it progresses

More Information

I'll add some more info about this project soon, including the code, but in the meantime here are some renders.

Copyright 2002 - 2007 Benny Kramek