The fundamental idea was simple:
Trying to convey the painstaking yet enjoyable path of implementing your own raytracer in a scene that resembles the long awaited relief of seeing your work in action.
Thus just like the tree anxiously awaited the next rainfall, I eagerly awaited portraying it doing so.
Initially the tree was supposed to be the only asset of the scene so I tried to highlight it from all angles by using mirrors.
But I scrapped that idea because the scene felt too empty, even for a dried out waste land.
So I decided to add some foliage in form of rock formations and the initial three raindrops.
The tree is rendered using smoothed triangle edges and scaled and translated to my liking using an instance of the original model.
The rock in the background and in the foreground are also rendered using smooth triangle edges and are the same model also transformed using instancing to give a feel of variety.
Likewise the three raindrops are all of the same sphere object that uses a glass material with refraction index of water (1.3325) and streching to make it look like rain.
(Originally the plan was also to include motion blur but I did not have the time to implement it working)
The ground is a dynamically created mesh of 100 triangles that make use of bump and texture mapping on a lambertian material to give the dried out earth a more realistic feeling to it.
The fata morgana in the background is implemented using a combination of a fuzzy mirror material that reflects the sky and the same material used for triangles on the ground.
The sky is a simple environment map that returns a predefined constant color whenever a ray does not intersect with anything.
The only lighting in the scene is an area light that samples a disc suspended in the sky above the tree to give the tree and the rock formation next to it a realistic smooth shadow.
The camera for the scene uses a depth of field effect with the focal distance adjusted to put the tree into focus.
The tree is rendered using normals that are interpolated based on the barycentric coordinates of the intersection point of the ray and the triangle. (striangle.h/.cpp)
In order to greatly increase the performance (final render time below) of the renderer I implemented a binning bounding volume hierarchy that incorporates a surface area heuristic. (bhv.h/.cpp)
The immitated fata morgana in the background is archieved by using a combined material consisting of a fuzzy mirror (0.5 weigth) and the material used for the ground of scene (0.5 weight). (combine.h/.cpp)
In order to represent to cloudless sky I implemented a very simple environment. Every time the ray does not intersect with the scene a predefined color for the pixel is returned instead of black. (recraytrace.h/.cpp)
In the second image the shadow of the sphere is not a black dot like that of a fully opaque object.
Instead when a shadow ray hits a transmitting object it checks if the resulting ray is a transmitted one (instead of reflected) and if so ignores the refraction and continues onwards
returning a fraction of the resulting radiance from that ray as the color of the shadow. (recraytrace.h/.cpp)
The high resolution render 1920x1080px took 2722,2 seconds (~45 minutes) and the low resolution 640x360px took 311,105 seconds (~5 minutes).
Both images were rendered with 1000 samples per pixels on an Intel™ Core i7 4720HQ with 16 GB of 2133 Mhz DDR3 RAM while making use of all 8 threads in a multithreaded rendering loop and optimized bounding volume hierarchy.
Lukas Selvaggio (firstname.lastname@example.org)