February 27, 2010

Sprint 4: Colour Spaces

Alas, another 4 months gone...too little time, too much to do...

Well, at least I have my Colour Space pretty much done, which now enables me to plot pixels in a neutral colour space.

My current colour space uses Floats to represent a spectrum, which is used to store an RGB triplet by default...nothing fancy here, I guess. But it enables me to extend it to non-RGB spectra in the future, in case I would like to do so. Also a function to map an RGB triplet onto an X11 colour parameter has been developed. Finally some supporting functions to construct a colour from 3 floats, add and multiply two RGB triplets.

In the future I exect to need a few more functions, like clamping and mapping RGB triplets as to support HDR and Tone Mapping in the future...I have prepared my Image Maps to allow for storage of the actual RGB triples as well to enable post-processing in some shape or form of all pixels.

The last bit I did was implement Kevin Suffern's example function to demonstrate aliasing. The function being sampled = (1 + sin(x^2 * y^2) / 2. The picture below shows this function in the range (x,y) in [0,4].



The picture below shows the function in the range (x,y) in [0,10]. Dramatic difference, huh? And you should also realized that I used 4 "samples" per pixel, so a single sample would even look worse...



So the next sprint will be focussing on an internal Object Data structure, as to store 3D objects. I will focus probably on a simple structure first, and hopefully doing some real ray tracing of spheres and planes...

Light makes right!
Marinko