Archive for March, 2009

Almost there…

Signs

Leave a Comment

Planes, Textures, and Soft Shadows

My toy raytracer written in Scala got a few new features:

  • Planes
  • Textures
  • “Soft Shadows” (distributed raytracing)
  • Supersampling Anti-Aliasing

Textures don’t add much to the computation time, but distributed raytracing is a real performance killer (at least when implemented naively, as in my version). Essentially, when determining the surface color at a given point, instead of sending just one ray to a lightsource to see if it’s obstructed by any other object, many rays (typically at least 25) are sent out to an area that describes the light source (e.g. a box). The return values (black if the ray was obstructed, the light source color otherwise) are then averaged, leading to smooth transitions at the edges. And it does look nice… combined with supersampling (anti-aliasing) it now becomes easy to spend hours rendering a single image at, say, 1024×768 pixels.

Pool Scene

Next idea: writing a parser combinator for (a subset of) POV-Ray’s Scene Description Language (SDL) to skip the painful step of modeling scenes in compiled code. This will also enable me to do some Scala coding again, since adding new features to the raytracer itself usually means spending much more time wrapping your head around math stuff than actually writing code.

Leave a Comment