title: How to use and blend multiple textures with custom values in Three.js?
body: <p>In Three.js, is it possible to create a material (shader?) containing a number of textures, each one with its own specifics, blend them together and assign to geometry? I'd like to simulate paper surface with multiple finishing techniques applied like foil embossing or spot UV varnishing. </p>
  
  <p>What I'd like to achieve is a material that would have the following characteristics:</p>
  
  <ol>
  <li>'Base' layer:
  
  <ul>
  <li>paper colour (e.g. white, off white, beige, etc)</li>
  <li>specularity</li>
  <li>reflectivity</li>
  <li>bump (smooth or textured paper)</li>
  </ul></li>
  <li>'Image' layer (optional):
  
  <ul>
  <li>image texture (artwork printed on paper, multiply-blended with 'Base' colour)</li>
  </ul></li>
  <li>'Foil' layer (optional):
  
  <ul>
  <li>b/w image texture to control layer transparency</li>
  <li>colour (overlapping 'Base' layer) </li>
  <li>specularity</li>
  <li>reflectivity</li>
  </ul></li>
  <li>'Emboss/Deboss' layer (optional):
  
  <ul>
  <li>bump texture (raising or lowering 'Base' bump)</li>
  </ul></li>
  <li>'Varnish' layer (optional):
  
  <ul>
  <li>b/w image texture to control layer transparency</li>
  <li>specularity</li>
  <li>reflectivity</li>
  <li>bump (slightly raising 'Base' bump)</li>
  </ul></li>
  </ol>
  
  <p>The reason for all the separate layers is I'd like to control them individually (replace different textures and change values at runtime). Apart from the 'Image' layer, I'm not sure what blend values I should use for the other layers to achieve realistic looking simulation.</p>
  
  <p>To illustrate the finishing techniques applied to paper, take a look at the following photographs (courtesy of PrintHouse Corporation):</p>
  
  <p><img src="https://i.stack.imgur.com/Nlx7w.jpg" alt="Blind embossing (pattern) &amp; gold foil debossing (logo, title)">
  <em>Blind embossing (pattern) &amp; gold foil debossing (logo, title)</em></p>
  
  <p><img src="https://i.stack.imgur.com/QFBGk.jpg" alt="Silver foil debossing (logo) and spot UV varnish (photos)">
  <em>Silver foil debossing (logo) and spot UV varnish (photos)</em></p>
  
  <p><img src="https://i.stack.imgur.com/LF8iw.jpg" alt="Spot UV varnish (lines)">
  <em>Spot UV varnish (lines)</em></p>
  
  <p>Is it at all possible? I couldn't find any Three.js example that would use such complex materials. If you could point me to one or explain how to approach this programmatically, I'd be grateful.</p>