Long Awaited

The final render of my scene

Concept

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. 

Process of Creation

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.

An early version of the scene ( without tree )

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. 

Highlight

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. 

Addidtional Features

Smooth Edges

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)

Surface Area Heuristic

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)

Combined Materials

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)

Simple Enviroment Map

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)

Better Shadows for transmitting Objects

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)

Render

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. 

Author

Lukas Selvaggio (s8luselv@stud.uni-saarland.de)

Downloads

1920x1080

640x360

References

Rock model

Ground textures

Tree model