Die Basis-Texturen


Durch die Texturen wird festgelegt, wie Objekte auf Licht reagieren. Im einfachsten Fall wird einfach ihre Farbe angegeben:


camera {
   location <0, 0.5, -6>
   look_at  <0, 0,   0>
}

light_source {
   <0, 20, -4>
   color rgb <1, 1, 1>
}

light_source {
   <-5, 1, -3>
   color rgb <1, 1, 1>
}

plane {<0, 1, 0>, -1.2
   texture {
      pigment {
         color rgb <0, 0, 1>
      }
   }
}

sphere {<0, 0, 0>, 1
   texture {
      pigment {
         color rgb <1, 0, 0>
      }
   }
}

Obige Kugel ist vermutlich aus Filz oder Gummi, denn sie zeigt keinerlei Spekulareflexion. Dieser spekulare Effekt kann durch die phong - Klausel eingeschaltet werden. "Phong" ist ein spezieller Algorithmus zur Berechnung der Spekularreflexion (Es gibt auch noch die specular- Klausel), der bewirkt, daß der Körper in Richtung der Lichtquelle deren Farbe annimmt:


/* ........... */
plane {<0, 1, 0>, -1.2
   texture {
      pigment {
         color rgb <0, 0, 1>
      }
   }
}

sphere {<0, 0, 0>, 1
   texture {
      pigment {
         color rgb <1, 0, 0>
      }
      finish {
         phong 0.9
      }
   }
}

Durch die reflection-Klausel können spiegelnde Oberflächen erzeugt werden:


/* ............... */

plane {<0, 1, 0>, -1.2
   texture {
      pigment {
         color rgb <0, 0, 1>
      }
      finish {
         reflection 0.8
      }
   }
}

sphere {<0, 0, 0>, 1
   texture {
      pigment {
         color rgb <1, 0, 0>
      }
      finish {
         phong 0.9
      }
   }
}

Die checker- Klausel erzeugt ein Schachbrettmuster:


/* ............... */
plane {<0, 1, 0>, -1.2
   texture {
      pigment {
         checker color rgb <0, 0, 1>
            color rgb <0.6, 0.6, 0.6>
      }
      finish {
         reflection 0.8
      }
   }
}

sphere {<0, 0, 0>, 1
   texture {
      pigment {
         color rgb <1, 0, 0>
      }
      finish {
         phong 0.9
      }
   }
}