fluxy - An Experimental Realtime 2d Path Tracer
(C)2008 Sebastian Mach, phresnel[at]gmail[dot]com, http://phresnel.org: Licensed under GPL, Version 3, or later at your choice. PLEASE READ THE FILE 'LICENSE'.
- zip-file with portable Sourcecode and GNU+Linux-Binaries
- tarball with portable Sourcecode and GNU+Linux-Binaries
fluxy is an experimental realtime path tracer in 2 dimensions. See  for an introduction to Global Illumination in 2d, thanks Thomas Ludwig (lycium) for that inspiring article.
To play with the light source, simply press the left Mouse Button, and Move the Mouse.
After reading  I wrote a 2d Path Tracer that rendered 2d-spheres (but with a bug in the reflection term, as lyc pointed out) with neat caustics, it can be found at . It was a lot of fun to write that thing, and so I wanted to see how it works in realtime.
Well, the code is highly sub-optimal, and resided on my box for way more than a year, and I should not release it because I could do better today. But then, it would have been waste, so here's the release anyways :)
This program has no serious industry use, it is more a show-off, or (at it's maximum) can be used for educational purposes (but I am not sure about the latter ;)).
build from source
Simplest way to build is to just <g++ `sdl-config --cflags --libs` *.cc>. Evident from that line is that you need SDL installed. Also note that with those parameters you get only half of the performance. There is a short script called src/bin/linux.native+sse/makeit with more decent optimization flags. It goes like this:
(ls amalgam.cc && rm amalgam.cc)>/dev/null
cp ../../*.cc ../../*.h ./
cat *.cc > amalgam.cc.tmp
mv amalgam.cc.tmp amalgam.cc
`sdl-config --cflags` \
-s -O3 -fexpensive-optimizations \
-combine -fwhole-program \
-msse -march=native \
-funroll-loops -fvariable-expansion-in-unroller \
-ftree-loop-im -ftree-loop-ivcanon -fivopts -fvect-cost-model \
-fmodulo-sched -fmodulo-sched-allow-regmoves \
-ftree-loop-ivcanon -ftree-loop-linear \
-funsafe-math-optimizations -ffinite-math-only \
`sdl-config --libs` \
As you can see, it cats together all source files into one file called amalgam.cc, which helps with the whole-program-optimizations (e.g. interprocedural analysis). Note that there are also other, generic builds included which run on most platforms (except when there is a "sseN" in the name than the target cpu must have support for that). Of course the most optimal program is produced if you run a script with "native", because that flag enables the compiler to generate code for exactly your machine.
Sidenote to me: Instead of writing shell-scripts I should write makefiles :|
That's all For now, have fun!
phresnel / Sebastian Mach (*1983)