Previous:Surface Finishes   Main Index   Next:Creating Color Patterns



Adding Bumpiness

The highlight we have added illustrates how much of our perception depends on the reflective properties of an object. Ray-tracing can exploit this by playing tricks on our perception to make us see complex details that aren't really there.

Suppose we wanted a very bumpy surface on the object. It would be very difficult to mathematically model lots of bumps. We can however simulate the way bumps look by altering the way light reflects off of the surface. Reflection calculations depend on a vector called a surface normal. This is a vector which points away from the surface and is perpendicular to it. By artificially modifying (or perturbing) this normal vector we can simulate bumps. We change the scene to read as follows and render it:

  sphere { <0, 1, 2>, 2

    texture {

      pigment { color Yellow }

      normal { bumps 0.4 scale 0.2 }

      finish { phong 1}

    }

  }

This tells POV-Ray to use the bumps pattern to modify the surface normal. The value 0.4 controls the apparent depth of the bumps. Usually the bumps are about 1 unit wide which doesn't work very well with a sphere of radius 2. The scale makes the bumps 1/5th as wide but does not affect their depth.



Previous:Surface Finishes   Main Index   Next:Creating Color Patterns