Evil Orb

Alberto González Palomo
screenshot

The code is derived from the solution to exercise 5, and uses only the objects and textures included there. Anything else is made procedurally. Click on the image above for the video.

Fractal Geometry

The tree is generated by recursively growing branches at the end of each one (the first one is the trunk), and growing leaves at the last recursion level. The branches are truncated cones of height 1 and same base diameter at the origin pointing upwards, which gets shaped and positioned using an affine transformation that is passed to the children.
The transformation is randomized, and the algorithm done in such a way that after adding recursion levels the random values for the previous ones are the same as before, so that the existing branches keep their shape as the tree grows.

Reflective and Refractive Transparency

Computes the reflected and refracted rays using Snell's law, and combines them proportionally using the Fresnel terms Rs and Rp, for s-polarized and p-polarized light.
Each ray has a field that indicates how big its contribution to the final image will be at maximum: if the reflected part is only 0.1, the contribution of the reflected ray will be equal or less that that, so if we reach a given threshold (set to 1/256 in the program) the recursion stops.

This is part of the MaterialPhongShader, that combines the PhongShader results with this to get a nicer final result.

Tone Mapping

Mapping the pixel values to keep as much detail as possible in the final image when they exceed the range [0,1].

Implemented by first avoiding clipping the pixel values when rendering th image, and then processing it when writing. Supports several modes:

Clipping: the values are just clipped as before.
Linear: the min/max values of the image are mapped to [0,1], and all intermediate values interpolated linearly.
Adaptive: first a correction field is computed, with its values being the correction factor to bring the pixel luminance into [0,1]. Then that field is blurred by a convolution (3x3 matrix) to have smooth transitions from one pixel to the next. Finally those values are used for correcting the pixels when writing the image. This actually does not help much, which is why I could not produce a good screenshot.

Stereo Rendering

A new stereoscopic camera produces stereoscopic images using a variety of techniques.
This camera contains two PerspectiveCameras inside, one for each eye, which converge on the focus point as set by calling pointTo() in the stereoscopic camera. (Note: these screenshots use an eye separation half of the submitted code: it's a number passed to the camera constructor)

Additional features