| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 
 | 
<!--  This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004  -->
<html> 
<head>
  
<!--  NOTE: In order to users to help find information about POV-Ray using  -->
 
<!--  web search engines, we ask you to *not* let them index documentation  -->
 
<!--  mirrors because effectively, when searching, users will get hundreds  -->
 
<!--  of results containing the same information! For this reason, the two  -->
 
<!--  meta tags below disable archiving and indexing of this page by all  -->
 
<!--  search engines that support these meta tags.  -->
 
 <meta content="noarchive" name="robots">
   
 <meta content="noindex" name="robots">
   
 <meta content="no-cache" http-equiv="Pragma">
   
 <meta content="0" http-equiv="expires">
   
<title>3.5.6 Layered Textures</title>
 <link href="povray35.css" rel="stylesheet" type="text/css"> 
</head>
 <body> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_119.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_119.html">3.5.5 Patterned Textures</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>3.5.6 
   Layered Textures</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_121.html">3.5.7 UV Mapping</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_121.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 
<h3><a name="s03_05_06">3.5.6 </a>Layered Textures</h3>
<p>
  It is possible to create a variety of special effects using layered textures. A layered texture consists of several 
 textures that are partially transparent and are laid one on top of the other to create a more complex texture. The 
 different texture layers show through the transparent portions to create the appearance of one texture that is a 
 combination of several textures. 
</p>
<p>
  You create layered textures by listing two or more textures one right after the other. The last texture listed will 
 be the top layer, the first one listed will be the bottom layer. All textures in a layered texture other than the 
 bottom layer should have some transparency. For example: 
</p>
<pre>
  object {
    My_Object
    texture {T1}  // the bottom layer
    texture {T2}  // a semi-transparent layer
    texture {T3}  // the top semi-transparent layer
  }
</pre>
<p>
  In this example T2 shows only where T3 is transparent and T1 shows only where T2 and T3 are transparent. 
</p>
<p>
  The color of underlying layers is filtered by upper layers but the results do not look exactly like a series of 
 transparent surfaces. If you had a stack of surfaces with the textures applied to each, the light would be filtered 
 twice: once on the way in as the lower layers are illuminated by filtered light and once on the way out. Layered 
 textures do not filter the illumination on the way in. Other parts of the lighting calculations work differently as 
 well. The results look great and allow for fantastic looking textures but they are simply different from multiple 
 surfaces. See <code> stones.inc</code> in the standard include files directory for some magnificent layered textures. 
</p>
<p class="Note">
  <strong>Note:</strong> in versions predating POV-Ray 3.5, <code>filter</code> used to work the same as <code>transmit</code> 
 in layered textures. It has been changed to work as filter should. This can change the appearance of "pre 
 3.5" textures a lot. The <code>#version</code> directive can be used to get the "pre 3.5" behaviour. 
</p>
<p class="Note">
  <strong>Note:</strong> layered textures must use the <code>texture</code> wrapped around any pigment, 
 normal or finish statements. Do not use multiple pigment, normal or finish statements without putting them inside the 
 texture statement. 
</p>
<p>
  Layered textures may be declared. For example 
</p>
<pre>
  #declare Layered_Examp =
    texture {T1}
    texture {T2}
    texture {T3}
</pre>
<p>
  may be invoked as follows: 
</p>
<pre>
  object {
    My_Object
    texture {
      Layer_Examp
      // Any pigment, normal or finish here
      // modifies the bottom layer only.
    }
  }
</pre>
<p class="Note">
  <strong>Note:</strong> No macros are allowed in layered textures. The problem is that if a macro would 
 contain a declare the parser could no longer guess that two or more texture identifiers are supposed to belong to the 
 layered texture and not some other declare. 
</p>
<p>
  If you wish to use a layered texture in a block pattern, such as <code> checker</code>, <code>hexagon</code>, or <code>brick</code>, 
 or in a <code> material_map</code>, you must declare it first and then reference it inside a single texture statement. 
 A patterned texture cannot be used as a layer in a layered texture however you may use layered textures as any of the 
 textures contained within a patterned texture. 
</p>
 <br> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_119.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_119.html">3.5.5 Patterned Textures</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong>3.5.6 Layered Textures</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_121.html">3.5.7 UV Mapping</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_121.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 </body> </html>
 |