Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Design of Surfaces by "texture" with POV-Ray -
Deutsch Deutsch
Italiano Italiano
Français français

- POV-Ray Tutorial

  Design of Surfaces
  - Colors and Textures

    texture Syntax
    > Basic Sample
    - pigment{ ... }
    - normal{ ... }
      - pigment_pattern
      - normal Samples
    - finish{ ... }
    Ready-made Textures
    - Rules
    Do-it-yourself Colors
    - color rgb< , , >
    - Transparency
    Patterns Lists

Your own Textures

Syntax of "texture"

Texture = Surface properties
(i.e. coloring, roughness, brightness, brilliancy, transparence)

Here is an example for the Syntax Rules of geometric objects:

sphere{<0,0,0>, 1 translate<0,1,0>
      texture{ pigment{color Orange}
               normal {bumps 0.5 scale 0.05}
               finish {diffuse 0.9 phong 1.0}
             } // end of texture
      } // end of sphere

A texture is totally descriped by the following 3 components:
  1. color property (must!):, including transparence (option!)
        pigment{ ... }    // color property should be defined!
  2. surface structur (roughness).
        normal  { ... }    // optional!
  3. brightness, shining and reflection properties:
        finish    { ... }    // minimum: "finish{ diffuse 0.9 }"
          see comments by "finish"

This clear form should be applied as consequent as possible. Sometimes also unclear and inconsistent descriptions with logical errors will work - often they are only producing some warnings during the rendering of this scenery.
Nevertheless, errors should be eliminated intensively because often they are the root for greater misunderstandings and the are often growing until they are causing a fatal error. On the other side: It is not sure that further versions of this program may tolerate these kind of today non fatal errors!

Colors, pigments and textures can be made "by hand" (as described in the following) as well as some of them they can be made with special programs for POV-Ray. But the using of those so called "texture editors" needs a well based knowledge about textures!

For testing textures it is recommended to use simple scenery files (monochrome sky and floor, camera, light_source (color White or color rgb<1,1,1>) in big distance like sunshine). As a test object we use a simple sphere and a box or a cylinder to compare the effects on different surfaces - this is very important if we use highlight effects like phong!

Some day we have made some own special colors and textures, which we want to use in an other scenery. This can be done by copying their definitions ("#declare MyRed = color <1, 0, 0.25>" ) in an own include file (e.g. with the name "") and including these definitions in the headlines of each own scenery description by #include "" . This own include file should be placed either in the directory "C:\programs\povray\include" where the include files were placed or in the directory where our actual .pov file is. At this places POV-Ray is seeking for include files by default. But please be carefully: don't make any changes in the original standard include files like "", "" etc. , because otherwise some example sceneries from other people meight not work correctly anymore!

Important: "scale", "rotate" and "translate" have an effect only on the things inside of the actual braces. So it is possible to scale, rotate or translate color patterns in "pigment{ ...}", as well as also simulated surface deforming by "normal{...}" independently by each other and separately from the geometric shape of a geometric object!


sphere{ <0,0,0>,1
        scale <1.2,1,1>
        translate<0,1,0> // effect only on sphere geometry!
                  scale 0.25 }// effect only on "pigment"!
          normal {wrinkles 0.75
                  scale 0.1} // effect only on "normal"!
          finish {ambient 0.15
                  diffuse 0.85
                  phong 0.3}
                 // effect on the whole texture,
                 // but not on sphere geometry !
        } // end of "texture"
       scale 0.5 //  effect on the sphere and the texture!
              //Attention: this has also an effect on
              // the translation by  "translate"!
              // sphere center is now at <0,0.5,0>>
     } // end of  "sphere"

© Friedrich A. Lohmüller, 2014