Povray beginner tutorial: Textures (finish) and interior

- Finish:

Finish controls the properties of the surface of an object.

- Highlights:

Highlights are bright spots that can be seen on the surface of objects in places where the light is directly reflected towards the viewer. There are two types of highlighting in Povray: Phong and specular highlight.
They can be used like:

finish { phong 0.5 phong_size 20 }
finish { specular 0.5 roughness 0.05 }
The number after the 'phong' and the 'specular' keywords express the amount of saturation of the highlight. 0 means no highlight and 1 means complete saturation to the color of the light.
The size of the phong highlight can be controlled with the 'phong_size' keyword. The smaller the value, the bigger the highlight.
The size of the specular highlight is controlled with the 'roughness' keyword. The smaller the value, the smaller the highlight.

Let's see an example:

camera { location <0,0,-10> look_at <0,0,0> angle 35 }
light_source { <100,200,-200> color 1 }

// A red sphere
sphere { <-2.2,0,0>,1 pigment { rgb <1,0,0> } }

// A red sphere with phong highlight
sphere
{ <0,0,0>,1
  pigment { rgb <1,0,0> }
  finish { phong 0.7 phong_size 20 }
}
// A red sphere with specular highlight
sphere
{ <2.2,0,0>,1
  pigment { rgb <1,0,0> }
  finish { specular 0.7 roughness 0.03 }
}

- Reflection.

One of the most notable features of raytracers is the ability to calculate reflections. You can make a reflective object with the 'reflection' keyword, like this:

finish { reflection 0.5 }
The number after the reflection indicates how much light is reflected from the surface. 0 means no reflection and 1 means that the surface reflects everything.

Now we can make the classic mirror-sphere-on-checkered-floor-image:

camera { location <-1,3,-6> look_at <0,0,0> angle 35 }
light_source { <100,200,-200> color 1 }

// The floor
plane { <0,1,0>,-1 pigment { checker rgb <1,0,0>, rgb <1,1,0> } }

// A mirror sphere
sphere
{ <0,0,0>,1
  pigment { rgb <0,0,0> } // A perfect mirror with no color
  finish { reflection 1 } // It reflects all
}

- Interior:

- Refraction.

Refraction has been moved to the interior-block in povray 3.1.

Water, glass, etc have the property of refracting light passing through it. This is more than just being a transparent material: it also refracts the light. Refraction is turned on like this:

interior
{ ior 1.5
}
The amount of refracted light is controlled with the filter value of the color of the surface.
The index of refraction is controlled with the 'ior' keyword. The IOR of the water is 1.33 and the IOR of the glass is 1.5.

Let's replace the mirror sphere with a refracting sphere:

camera { location <-1,3,-6> look_at <0,0,0> angle 35 }
light_source { <100,200,-200> color 1 }

// The floor
plane { <0,1,0>,-1 pigment { checker rgb <1,0,0>, rgb <1,1,0> } }

// A glass sphere
sphere
{ <0,0,0>,1
  pigment { rgbf <0.5,0.9,1,0.95> } // A blue-tinted glass
  interior { ior 1.5 } // Glass refraction
}

This is not a very realistic glass since real glass always reflects some of the light and has also highlights. Let's make a better try:

camera { location <-1,3,-6> look_at <0,0,0> angle 35 }
light_source { <100,200,-200> color 1 }

// The floor
plane { <0,1,0>,-1 pigment { checker rgb <1,0,0>, rgb <1,1,0> } }

// A glass sphere
sphere
{ <0,0,0>,1
  pigment { rgbf <0.5,0.9,1,0.95> } // A blue-tinted glass
  finish
  { phong 0.9 phong_size 40  // A highlight
    reflection 0.2  // Glass reflects a bit
  }
  interior
  { ior 1.5 // Glass refraction
  }
}
Now, this is much more realistic.
(If you wonder why the glass looks green instead of blue, that's because the floor is yellow and red; if we replace it with a white floor, then the glass will look blue.)

See the section 7.6.3 (pov3.0) or 4.7.3 (pov3.1) of the Povray documentation for more information about finish.