title: Compute normals from displacement map in three.js r.58?
body: <p>I'm using the normal shader in three.js r.58, which I understand <a href="https://stackoverflow.com/questions/17453298/twisted-normals-with-the-three-js-normal-shader-r-58">requires a normal map</a>. However, I'm using a dynamic displacement map, so a pre-computed normal map won't work in this situation.</p>
  
  <p>All the examples I've found of lit displacement maps either use flat shading or pre-computed normal maps. Is it possible to calculate the normals dynamically based on the displaced vertices instead?</p>
  
  <p><strong>Edit:</strong> I've posted <a href="http://meetar.github.io/three.js-normal-map-0/index3.html" rel="nofollow noreferrer">a demo of a sphere with a displacement map showing flat normals</a>:</p>
  
  <p><img src="https://i.stack.imgur.com/Xk32V.jpg" alt="Sphere with displacement but incorrect normals"></p>
  
  <p>Here's a link to the github repo with all of my examples illustrating this problem, and the solutions I eventually found:
  <a href="https://github.com/meetar/three.js-normal-map-0" rel="nofollow noreferrer">https://github.com/meetar/three.js-normal-map-0</a></p>