Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

textures "pigment"

Surface Design by "texture"

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 {ambient 0.1 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 propertie should be defined!
  2. surface structur (roughness).
        normal  { ... }    < - optional!
  3. brightness, shining and reflection properties:
        finish    { ... }    < - minimum: "finish{ambient 0.1 diffuse 0.9}"
          see comments by "finish"

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


Colors, pigments and textures can be made "by hand" (as descriped 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 knowlegde about textures!

For testing textures it is recommanded 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 highlightning effects like phong!

Some day we have made some own special colors and textures, which we want to use in other sceneries. This can be done by copying their definitions (#declare MyRed = color <1, 0, 0.25> ) in an own include file (i.e. with the name "mycolors.inc ") and including these definitions in the headlines of each own scenery description by #include "mycolors.inc" . This own include file should be placed either in the directory "C:\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 carfully: don't make any changes in the original standard include files like "colors.inc", "textures.inc" etc. , because otherwise some scenery sampes 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{...}" indepedently by each other and seperately from the geometric shape of a geometric object!

Sample:


sphere{<0,0,0>,1
       scale <1.2,1,1>
       translate<0,1,0> // has an effect only on sphere geometry!
       texture{
         pigment{Candy_cane
                 scale 0.25 }// has an effect only on "pigment"!
         normal {wrinkles 0.75
                 scale 0.1} // has an effect only on "normal"!
         finish {ambient 0.15
                 diffuse 0.85
                 phong 0.3}
         rotate<0,0,45>
                 // has an effect on the whole texture,
                 // but not on sphere geometry !
              } // end of "texture"
       scale 0.5 // has an 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"

textures "pigment"

© Friedrich A. Lohmüller, 2005
email email: (legacy email redacted)
homepage:www.f-lohmueller.de