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 Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: