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

Home
- POV-Ray Tutorial

  Design of Surfaces
  - Colors and Textures
    Index

    texture Syntax
    Ready-made Textures
    Do-it-yourself Colors
    Patterns
    Patterns Lists
    Warps
    uv_mapping
    Mapping
    - Mapping Methods
    - color_map{ ... }
    - pigment_map{ ... }
    - texture_map{ ... }
    - normal_map{ ... }
    - average
    - material_map{ ... }
    - image_map{ ... }
    - image_map+gif 1
    - image_map+gif 2
    - image_map+gamma
    - bump_map{ ... }
    - transparency maps 1
    - transparency maps 2
   > transparency maps 3
    Superpositions

   Your own Textures
 
                                           
Transparency mapping (3) - Transparency controlled by Patterns -
Example 4: Acer Leaf
The transparent cut out and texturing of a leaf.
Here we need a photo of a real leaf, prepared in an image editing program.
//-------------------------------------
#declare P_Map = // pigment map ------
 pigment{
   image_map{ jpeg "Acer01_diff.jpg"
              interpolate 2 once
            } //
        } // -------------------------
#declare T_Map = // transparency map -
 pigment{
   image_map{ jpeg "Acer01_trans.jpg"
              interpolate 2 once
            } //
        }// --------------------------
#declare N_Map = // normal or bump map
 normal{
   bump_map{ jpeg "Acer01_bump.jpg"
        interpolate 2 bump_size 5 once
           } //
       } // --------------------------
#declare Leaf_Texture =  //-----------
texture{ pigment{ P_Map }
         normal { N_Map }
         finish { phong 0.5 }
       } // --------------------------
//------------------------------------
#declare Leaf_Material =  //----------
material{
   texture{
      pigment_pattern{ T_Map }
      texture_map{
        [0.0 pigment{rgbf<1,1,1,1>}]
        [0.7 Leaf_Texture  ]
        [1.0 Leaf_Texture  ]
       } // end texture_map
     }// end texture
  }// end material -------------------
// -----------------------------------
sphere{ <0,0,0>,0.65
        scale<1,1,0.75>
        translate<0.5,0.5,0.1>
        clipped_by{
           box{ <0,0,0>, <1,1,-1> }
         } // clipped_by
        material{ Leaf_Material }
        rotate< 60,-90,0>
        translate<0.63,-0.69,-0.46>
 } // end of box ---------------------
//-------------------------------------

Note: Save the according image files in the same
  subdirectory like the scene files or
  in any other subdirctory in your include file paths.

Example trancparency mappping
The image used here as pigment map:
Acer01_diff.jpg (512x512 pixels)
Example pigment mappping
The image used here as transparency map:
Acer01_trans.jpg (512x512 pixels)
Example trancparency mappping
The image used here as bump map:
Acer01_bump.jpg (512x512 pixels)
Example Acer Leaf
Version without gamma correction for POV-Ray 3.7:
POV-Ray 3.7 scene file: Acer_Leaf_01.pov,
needs the three images from above!!! Gamma corrected Version for POV-Ray 3.6.2:
POV-Ray 3.6 scene file: Acer_Leaf_01_36.pov,
needs the three images from above!!!
top

© Friedrich A. Lohmüller, 2012
http://www.f-lohmueller.de