Calad

Introduction

A small ray tracing project. The code is in C++ and licensed under the zlib/libpng license.

Right now I'm only using Monte Carlo ray tracing techniques; i.e. no photon mapping or other global solutions. As this is my first semi-serious work in the non-realtime area, I'm letting it evolve, rather than trying to do everything at once.

It seems to be working, so far.

Download

Calad isn't currently usable, but resides in a public monotone repository on mtn.elmindreda.org, in the branch org.elmindreda.calad.

Roadmap

Features currently in progress:

27/10 2007

Sitting at Jamaica ROM working away on the Moira port of Calad. More and more bits are compiling. Yay.

Also, there have been some changes since the last time I worked on Calad. Render times before this entry are on an 800 MHz PowerPC G3. Render times from this point forward are on a 1.6 GHz Core Duo.

12/06 2005

Made a little real-time ray tracing Dock demo with Calad, for the Rushed Metal demo compo.

02/02 2005

Note; the development of Calad has ceased temporarily, while I develop the Wendy engine. When that code base reaches a usable state, I will move Calad over to it, to take advantage of its facilities.

Development of Calad will then proceed.

17/10 2004

Added a rudimentary POSIX command-line driver. Productivity much improved. CLI tools are nice.

Added render timing to the POSIX driver. Render times are no longer guesswork.

camilla@sharon~/Projects/Calad/build$ ./calad -s 2 ~/Desktop/Calad/009.xml
Added scene file "/Users/camilla/Desktop/Calad/009.xml"
Using camera "default"
Using target resolution of 640x480
Using 2x2 supersampling
Using adaptive depth control limit of 0.10
Rendering... Finished after 112.37 seconds

Added a new sample-based light interface, unifying directional, point, spot and area lights, without the renderer ever needing to tell them apart.

Added a simple sphere area light. It currently has a ridiculously stupid sampling selection. I'm working on it.

Started rendering my own thumbnails, instead of scaling down the full-size renders (Dicander, 2004).

Render #9:

Scene: File.
Settings: Regular 2x2 supersampling, 100 area light samples.
Render time: 1 minute 52 seconds.

Some people have asked what this area light thingy is all about. I'd like to illustrate with the following, hideously ugly render.

Scene: File.
Settings: Regular 2x2 supersampling, 100 area light samples.
Render time: 2 minutes 53 seconds.

The shadow on the left is made by an area light, while the one on the right is made by a point light. If you're still wondering why it's worth having area lights, then I can't help you.

Added a simple form of directional lights. Room for improvement exists.

Cleaned up various internal interfaces.

15/10 2004

Added tons of support code and primitive/frustum intersection tests.

Rendering is down, pending interface stabilisation.

Made a quick and sloppy attempt at converting my latest scene to the famous POV-Ray renderer.

Rendered by POV-Ray Rendered by Calad

Scene: File.
Render time: About as slow as Calad.

Scene: File.
Render time: About as slow as POV-Ray.

Note that I didn't attempt to get a similar rendering output.

Instead, I tried feeding them as similar a dataset as possible.

Anyone who's more fluent in SDL is welcome to suggest improvements.

I'm guessing from the results that POV-Ray defines the camera's position as the primary ray convergence point, which would account for the difference in distance, since Calad no longer does this. Perhaps I should switch back.

13/10 2004

Simplified the XML scene format a bit.

Fixed a bug in the refraction calculations.

Redesigned various internal interfaces.

Stress. Lots of it. No real progress today.

12/10 2004

No new features today. Just played around, making something a bit more realistic than before.

Fixed a few bugs that arose during the making of today's image.

Scene: File.
Settings: Importance limit of 0.1, 10x10 depth of field supersampling.
Render time: Slow, all right?

The ruby's caustics are sorely missed.

Note to self; I should write the same scene in POV-Ray and compare the results.

11/10 2004

Added support for multiple, named cameras in scenes.

Added rudimentary XML scene loading capability.

Added the specular refraction part of global transmissiveness. (That's transparency in English.)

Scene: File.
Settings: Importance limit of 0.1, 10x10 depth of field supersampling.
Render time: Cup-of-coffee-slow.

It's official; the new renderer now supports every single feature the previous one had, and it does them better.

Still haven't changed the aperture size unit...

10/10 2004

Added oriented boxes as primitives.

Expanded local reflection model to full Phong.

Added depth of field. For now it's considered a supersampling method, so it cannot be combined with any other such method. This shows quite clearly close to the focal plane.

Started using other surface materials in test scenes.

Cleaned up the camera's image plane model, as a nice side-effect of implementing depth of field.

Scene: Two spheres, a plane and a box, with various materials. One point light source.
Settings: Recursion depth of 3, 10x10 depth of field supersampling, importance limit of 0.1, aperture width of 100 pixels.
Render time: Really, really slow.

Note to self; switch to a saner aperture size unit.

9/10 2004

Resolved the silly specularity bug, and various others.

Corrected a stupid mistake in the local term of the lighting model.

Added local Phong-like model.

Scene: Two intersecting spheres, sharing a purple surface material. One point light source.
Render time: Still just as slow.

Added basic global specular reflection.

Scene: Two spheres and a plane, sharing a purple surface material. One point light source.
Settings: Recursion depth of 3.
Render time: Even slower, but pretty.

Added regular (brute-force) supersampling.

Scene: Two spheres and a plane, sharing a purple surface material. One point light source.
Settings: Recursion depth of 3, 3x3 supersampling.
Render time: Slow beyond belief, but even prettier.

Added adaptive depth control (Hall and Greenberg, 1983).

Scene: Two spheres and a plane, sharing a purple surface material. One point light source.
Settings: Recursion depth of 3, 3x3 supersampling, importance limit of 0.1.
Render time: Not noticeably faster, but slightly different results.

I know I'm still using the same surface material on all objects.

I do have a fully functional surface material system. I just happen to like purple.

8/10 2004

Silly specularity bug plauges output.

Yay for the speed of square roots.

30/9 2004 - 7/10 2004

My beloved cat Pixel past away.

May she rest in peace.

Grief and madness.

29/9 2004

Imported expat into project.

Decided on initial basic lighting model.

Stuck in XML format and surface property system design bog.

28/9 2004

New renderer sort of almost working; casts primary rays.

Scene: A single sphere.
Render time: Slowest white circle ever.

27/9 2004

Threw away previous, quick-and-dirty renderer.

Begun planning of new renderer.

Here is a rendering from the old renderer:

Scene: Three spheres, one diffuse, one reflective and refractive, one fully reflective. Six planes. One point light source.
Settings: Recursion depth of 20.
Render time: About three seconds.