Pov25
Ray tracing 25 scenes in 25 days with POV-Ray
Install / Use
/learn @susam/Pov25README
Ray Tracing with POV-Ray
Four years ago, I wrote a simple ray tracer in Java to render a scene hard-coded in the source code. After writing this ray tracer, I came to know about sophisticated ray tracing engines available for free on the internet. POV-Ray seemed to be one of the most popular engines and I decided to learn to use it. However, I never managed to devote time to learning it in the last four years. Finally, in May 2013, I decided to teach myself to do ray tracing with POV-Ray. This activity consisted of learning the concepts required to write scene descriptions for POV-Ray, and writing a new scene each day for 25 days in the month of May 2013.
Contents
A scene a day
-
Balls and boxes
![Balls and boxes][S01]
This scene consists of three spheres and three boxes. The scene is illuminated by three point light sources.
One light source is shining from the top right corner of the scene. This light source is behind the camera. This casts the shadow of the green box on the blue ball and that of the blue ball on the yellow one.
Another one is shining from the left side of the scene. This light source is also behind the camera. This casts the smaller shadow of the red box on the blue ball, that of the green box on the orange ball and that of the blue ball on the pale pink box.
There is a third light source at the bottom right corner of the scene. This light source is present slightly in front of the camera. This casts the longer shadow of the red box on the blue ball.
-
Transformed Boxes
![Transformed Boxes][S02]
The white box is centred at the origin. The camera is placed 10 units behind the origin. One light source is placed 10 units behind the origin, i.e. at the same place where the camera is. There is another light source shining from the top left corner of the scene.
All boxes except the three boxes in the bottom-right quadrant of this image have the same dimensions as that of the white box.
The red box is translated to <2, 2, 2>, i.e. 2 units left from the origin, 2 units above the origin and 2 units further away from the origin in the direction perpendicular to the image.
The green box is translated to <5, 5, 2>, i.e. it has been shifted further way towards the top right corner. As a result we can see more of its left and bottom faces.
The blue box is translated to <5, 5, 5>, i.e. it is placed 3 units behind the green box. As a result it appears smaller than the green box.
The yellow box is first rotated around z axis by 45° and then shifted left by 5 units
The cyan box is first shifted left by 5 units and then the box is rotated around z axis by 45°. In the rendered image, it can be seen that the whole box as a whole orbits around the z axis due to the rotation and occupies a new place 45° away from the yellow box in this orbit.
The length of the brown box is first doubled along x axis, then it is rotated 45° around y axis. As a result, the elongated face is rotated towards left. Then it is translated to a new position below the origin, a little further away towards the right.
The pink box is first rotated 45° around y axis. Then it is scaled by a factor of 2 along x axis. As a result, the diagonal of the box running along x axis seems to be elongated. Finally, this box is translated and placed right below the brown box.
The maroon box is first rotated along y axis by 45°. Then it is translated to a new position right below the pink box. Finally, it is scaled by a factor of 2 along the x axis. As a result, the box appears to have moved further along the x axis. Also, its diagonal along the x axis appears to be stretched.
-
Marble Sphere in Rubber Torus
![Marble Sphere in Rubber Torus][S03]
There are two light sources in this scene: one where the camera is situated, and another on the left side of the scene.
The sphere and the torus appear to be specular due to Phong highlighting. As a result, two bright shiny spots can be seen on the sphere as well. One spot is closer to the camera while the other one is on the left side of the sphere. These spots are due to the two light sources. Similar but fainter shiny spots can be seen on the torus as well. The specular highlights on the torus appear fainter because a less saturation value was used for the Phong highlighting was used for the torus.
In addition to making the sphere specular, it has also been made slightly reflective. As a result, a faint reflection of the torus can be seen in the bottom hemisphere of the sphere.
-
Crystal Ball
![Crystal Ball][S04]
There are two light sources in this scene: one at the centre of the ceiling and another at the top of the wall opposite to the camera. The walls are glossy, and thus reflect the scene slightly.
There is a mirror on the wall opposite to the camera. The mirror has a wooden frame. The reflection of a door in the wall behind the camera can be seen in the wall opposite to the camera.
There is a crystal ball placed on a wooden block. There are two other coloured balls lying on the floor.
-
Prisms
![Prisms][S05]
The room in this scene is similar to the room in the previous scene. However, in this scene the floor is reflective instead of the walls. The balls are missing from this scene and there are two prisms instead on the wooden block. The reflection of the door behind the camera can be seen in the mirror on the wall opposite to the camera.
-
Ripples
![Ripples][S06]
This scene contains a rubber tube floating on water. There are ripples on the surface of water. The ripples have been made slightly turbulent in order to make it look a little natural.
-
Textures
![Textures][S07]
This scene contains a wooden block and spheres with various textures placed on the floor of a room. The block is made of pine wood. There is a ruby glass sphere placed on the block. There is a pink granite sphere placed between the mirror and the wooden block. The leftmost sphere is made of white marble. The one to its right is made of brown agate. The next sphere that looks dark is made of blue agate. The reflective sphere on the floor is made of aluminium. The rightmost sphere is made of red marble. The mirror at the back shows a reflection of the scene.
-
Window
![Window][S08]
This scene shows light entering a room through a window. Isotropic scattering makes the light beam coming through the window visible.
-
Sky and Water
![Sky and Water][S09]
This scene contains water and sky. The sky contains clouds and the water contains irregular ripples. The water reflects the sky.
-
Soft Shadows
![Soft Shadows][S10]
This scene contains a few marble balls and metal rods placed on a wooden plank. The scene is illuminated by three area light sources. The area light sources cast soft shadows. The light sources fade away with distance. As a result, the scene at the top left corner of the image appears to be darker than the rest of the scene. The soft shadows and the fading light sources make this image seem quite photorealistic.
-
Focal Blur
![Focal Blur][S11]
This scene contains six coloured balls lying on a tiled floor. The camera is focussed on the white ball at the centre. The shallow depth of field causes other balls to blurred.
-
Pawns
![Pawns][S12]
This scene contains a white pawn and a black pawn placed on a chessboard. There are two light sources shining on the chessboard: one from the left side and one behind the chessboard.
-
Glass Pawns
![Glass Pawns][S13]
This scene contains glass pawns placed on a glass chessboard.
-
Globe
![Globe][S14]
This scene contains a globe placed on a glossy surface. The globe was created by wrapping a map of the earth around a sphere. The map used to create this globe can be found in the maps directory.
-
Saturn
![Saturn][S15]
This scene is an attempt to model Saturn along with its five prominent rings. The planet and the rings are drawn to scale.
The innermost ring is the D ring. The next ring that appears to be translucent is the C ring. The next opaque ring is called the B ring. Then there is a gap called the Cassini Division. After this division, lies the A ring. The A ring contains a thin gap called the Encke Gap. The outermost thin ring is the F ring. The region between the A ring and the F ring is called the Roche Division.
The shadow
