title: Render "hard" edges using custom shader
body: <p>I'd like to reproduce the effect created by using <code>THREE.EdgesHelper</code> (drawing a boundary on "hard" object edges), but using a custom shader rather than adding a separate <code>THREE.Line</code> object. Essentially I'd like to do what's done in <a href="http://threejs.org/examples/#webgl_materials_wireframe" rel="nofollow">this demo</a>, but only for the "hard" boundaries; e.g. boundaries that are not between two coplanar faces</p>
  
  <p>Approach: apply similar routine to <code>EdgesHelper</code>, but mark vertices that are in hard edges with a custom attribute (e.g. <code>isEdge</code>); probably need to use <code>BufferGeometry</code>, since regular <code>Geometry</code> allows re-use of vertices in multiple faces, but <code>BufferGeometry</code> duplicates vertices such that each vertex is part of only one face (at least, this is my understanding; the documentation isn't explicit).</p>
  
  <p>Progress so far:</p>
  
  <ol>
  <li>Reproduced the effect in the wireframe materials example, but using <code>BufferGeometry</code>: <a href="http://jsfiddle.net/ogav6o77/" rel="nofollow">http://jsfiddle.net/ogav6o77/</a></li>
  <li>Port the logic of <code>EdgesHelper</code> to a "<code>BufferEdgesHelper</code>" function that works with <code>BufferGeometry</code> (but still use it to create a <code>THREE.Line</code>): <a href="http://jsfiddle.net/L2aertya/" rel="nofollow">http://jsfiddle.net/L2aertya/</a></li>
  <li>Attempted to adapt the <code>BufferEdgesHelper</code> to save its results in a custom attribute (<code>isEdge</code>), then read that attribute in the custom shader when deciding whether to render the edge or not: <a href="http://jsfiddle.net/4tf4c6sf/" rel="nofollow">http://jsfiddle.net/4tf4c6sf/</a> </li>
  </ol>
  
  <p>The first two fiddles work as expected, showing (1) the white wireframe edge rendered by the shader, then (2) the white edges from the shader plus the red "hard" edges from the <code>Line</code>. However, (3) gives the same results as (2), rather than using the <code>isEdge</code> attribute to decide whether to draw a line or not; I can't figure out why that is. </p>
  
  <p>Any idea how to fix this so that <em>only</em> the hard edges are rendered by the shader (e.g. the red and white lines overlap)?</p>
  
  <p>Thanks!</p>