Here you will find a collection of things I've worked on or found interesting and worthwhile to post. There is some poetry and other written works, as well as projects and programming thoughts/ideas/tips.

Global Illumination Irradiance Estimation and Photon Prunning

Photon irradiance is estimated using a spherical area. However this alone will produce incorrect results. Check out this image, notice banding along all the surfaces that meet at 90 degrees. This is because just grabbing all the photons within a sphere gets photons from both surfaces, when really the photons from surfaces that are orthogonal to each other should not contribute to the lighting.

Multi-Threading and Storing Photon Maps

Well, since I'm running with a Core Duo I decided to implement multi-threading for the photon scattering step since thats where 90% of the time is spent. It works great and was very simple to do, required very little restructuring of my code.

And to add another speed book I made the photon map serializable so that I can save and load them to disk. It saves some time, but the deserializing process is


and I mean slow. But it helps.

More to come later, this was just a quick note between renders.

Reflections: So Smooth, Yet So Rough

So far our reflections only work on surfaces made of materials that are perfectly smooth. In the real world not all surfaces are pefectly smooth yet are still reflective. So to simulat this for doing refletions we cast multiple rays out from the reflection point to caclulate the direction they are cast we take the normal of the surface at the hitpoint and purterb it using a random gaussian variable. The roughness/smoothness is the standard deviation of the gaussian distribution used for perturbing the normals. So the larger the standard deviation the rougher the surface appears.

Photon Mapping

Photon mapping is a way to do illumination in 3D graphics. This is my computer graphics project from college.


EveryBlog is meant to be a replacement for the default Drupal Blog module.

May 25, 2009: EveryBlog is pretty much tabled as the core functionality is easily implemented using views and taxonomy, this site for instance is using taxonomy for both tagging posts and placing them within specific "blogs" and then views are used to display matching posts. Hence the overhead of an entirely seperate module is not needed as it is fairly easily to do using existing solutions which are likely to be far more stable due to their larger development community.

EveryBlog 1.x Released


EveryBlog is the every man of blog modules. Its a replacement for Drupal's built-in Blog module that allows users to have multiple blogs. Each blog has its own name instead of being "So-in-so's Blog" and blogs can be grouped into categories. Categories are actually just a vocabulary that you have chosen to use for categorizing blogs (set via the settings page).

Players and Paradigms

Success! Atleast with GI

CaptionThis has been an incredibly annoying project. Granted it stems from the fact that I didn't have all the resources I needed as far as the minute detials behind programming the ray tracer.

Quads as Area Lights

A bit out of order, but this post will deal with my work on using quads for area lights. Okay, here's the deal, how do you pick a random point from the interior of a quadrilateral and ensure that the distribution is as uniform as possible? Good question ehh? My math prof thinks so too. We discussed several methods. We are doing this because we need to emit photons from the surface of the light.

The following pictures of distributions are plotted with 2500 points.

Method A: Corners Method

Its easy to select a point inside the parallelogram defined by a triangle, so divide the quad into four triangles, pick a point inside each corresponding parallelogram and average them together. Nice and simple, but it creates a distribution that is obviously not uniform, it shows a strong bias for the center of the quad. To be fair, this was of my own invention. (The red, green, yellow, and cyan dots are from the four triangles, the blue are the actually points.)



Photon Mapping: What is it?

Okay, really quick, photon mapping is where we cast photons from the light out into the scene we are drawing and store their interactions with the geometry in a photon map. Then we to a raytrace on the scene, but when we do our lighting calculations we use the information in the photon map as well as direct illumination. This gives us indirect illumination, and with the addition of a second photon map we can do good, cheap caustics. For more info check wikipedia.


Subscribe to  Glimpses RSS