100DaysOfGameDev: Day 42
Ray tracing rocks! Here is the list of stuff I've done today ( again in reverse chronological order ):
* Added Gamma Correction.
* Removed unnecessary sample.
* Added True Lambertian Reflection
* Patched shadow acne problem.
* Added ray bounce limit.
* Added simple diffuse material.
* Added basic anti-aliasing.
* Moved renderer logic into a separate camera class.
* Clean up and support for OS X.
* Fixed parameter list for main.
* Added utility class interval.
* Improved main. Sphere hit bugfix
Yet again, below is the evolution of the output image after each major change ( in chronological order )
With a ground ( actually another sphere ). If I didn't have a bug yesterday, you were supposed to see this.
Sphere with basic diffuse and uniform light bounce.
Sphere after shadow acne fix. This one was an interesting case of floating point rounding errors. Sometimes a ray would bounce with a bit of offset from the actual hit point. This would result in the ray origin to be a bit above or below the surface. In case it was below, it would be reported extra dark area.
True Lambertian Reflection. Actually, it is much simpler, than what is sounds to be.
Gamma correction!
That's it for today. Code is as always available in my github page. I have implemented some more stuff, but there is currently a bug, so I will leave it for tomorrow. See you!