Around the Eiffeltour
by Achim Schwender
Click on the image to download the animation.
back to top
A camera with a thin lens and an aperture is simulated.
Everything which is not in the focus of the camera
gets blurred. The intensity of the blurring is determined by the size of the aperture.
A larger aperturesize means a more intense blurring.
To achieve this effect, not only one primary ray is traced per pixel,
but several rays which are randomly distributed on a disc and which all meet at the focus.
To determine the actual color of a pixel the average over the results of
all rays is computed.
This effect is visible in almost every frame of the animation.
DepthCamera.hxx
back to top
The Procedural Shader generates realistic looking textures
for natural materials like granite or marble.
This is achieved by the use of fractal noise and turbulence functions.
The implementation uses a 3d version of perlin noise.
More information about perlin noise can be found
here .
Both the teapot and the dragon are rendered with a marble like texture which
is generated by the Procedural Shader.
ThreeDPerlinShader.hxx
back to top
The mountains in the background of the animation are an example for fractal geometry.
The computation begins with a rectangular base area.
A pseudo random height is assigned to the centerpoint CP of this rectangle.
Then the rectangle is subdivided into 4 smaller rectangles,
each with CP as a corner.
This procedure is repeated several times.
Then triangles are build using the just computed points as vertices.
Finally the vertex normals are computed by summation over
all the triangle normals that belong to a certain vertex.
FractalGeometry.hxx
back to top
To speed up the rendering process a KD-Tree with a
Surface Area Heuristic (SAH) is used.
This is done as described in the paper by Ingo Wald and Vlastimil Havran: "On building fast kd-Trees for Ray Tracing and on doing that in O(N log N)"
.
Here a small benchmark to show to performance increase: