Sunday, November 22, 2009

Fractal Viewer v0.1

This past week I sat at my desk and munched on a Subway meatball sandwich while browsing through Wikipedia.  I read an article on the Mandelbrot fractal, which I think is pretty darn neat.  So neat, in fact, that I started planning on programming my own real-time viewer of this impressive mathematical piece of artwork.  This came to some dismay of my coworkers (as my meatball sandwich contained an impressive amount of delicious but odoriferous peppers and onions) when I asked them questions like, "How does one solve (A + Bi)^0.5.  It was a legitimate question, though not one necessary for the computation of a fractal.  That's actually pretty easy.

And when I got home I started programming.  Feverishly.  I have been consumed by learning to develop in C# and in particular programming the GPU.  Along the way I discovered some of the shortcomings of the older shader models.  Of particular vexation is that the older shader models support only a very limited number of instructions on the GPU.  Relatively old video cards will support shader model 2.0.  This shader model has a maximum number of instructions on the GPU of 96.  I'm using 1296.  Oops.  Thus this program requires shader model 3.0 and a relatively newer video card.  Without it, the program just crashes.  Maybe I should introduce some sort of check to see if the user video card can support it?

Anyways: too many words, not enough pictures!

The Mandelbrot Set

And the Julia Set

Here's the download.  You'll also need the XNA runtime library.  Try it out.  But be sure to read the readme file.  It has instructions on how to zoom in and out as well as pan around.