They should have called it clay (you know, model stuff, like with clay ;); the first thing I thought of was http://www.cray.com supercomputers. Maybe that was intentional.
After browsing the source, it seems they are using Java2D primitives, specifically BufferedImage to do textures and shaders. I wonder if this project could use JOGL bindings...
EDIT: btw, I meant to say that this looks pretty badass
Right, although there are options to combine the two.
Shader language can be used to write raytracers running entirely on the GPU, rendering the output to merely two textured triangles streched over the screen.
However as we are talking about Clojure, not shader languages, an alternative way would be offloading some of the weight lifting to OpenGL, for example by calculating visibility using the videocard's z-buffers or creating shadow maps by rendering the scene from the lights' viewpoint into shadow buffers and using the results in the raytracer.
Ah, thanks, that makes sense. What I was thinking of was the many times I've crashed java by trying to load/render decently sized images in memory (something about how heap space takes awhile to dynamically allocate). You could specify initial heap size with a command line flag, but it was hacky and I had a hard time getting it to work consistently.
Looking at it made me curious. Is there any ray tracer that includes the effects of gravity when tracing the rays? You would have to model in terms of solids and give materials densities.
"As you can see, adding this feature slows down the rendering by a factor of 4, but I think it's a small price to pay for the added accuracy, even if you can't see it."
There's a sample image below which it says "First results, 83 lines of code." Is that the total number of source lines in that version of the raytracer? Wow! I mean, the sample doesn't look especially beautiful, but 83!! WOW!!
Hi there, I wrote this ray tracer. Thanks to everyone for your positive comments. I don't have a copy of that version any more, but it was 83 lines from start to finish, including the scene description and dealing with Java to display the image. No AA or multi-CPU support, but point-light sources and reflection, and a little general-purpose vector library.
There was probably more code on each line than is typical Lisp style, though.
There are some techniques in the code for getting good performance (as good as Java at least) for mathematical routines - the JVM is the limiting factor rather than Clojure.
I hope it helps to show that Clojure is a practical language, since the concepts in it are going to be important in the near future. Also, if anyone is impressed by shiny spheres and wants to talk of entrepreneurial things, email's on the project page. :)
After browsing the source, it seems they are using Java2D primitives, specifically BufferedImage to do textures and shaders. I wonder if this project could use JOGL bindings...
EDIT: btw, I meant to say that this looks pretty badass