title: Lights and shade with a custom fragmentShader
body: <p>I'm creating a sphere and adding distortion to it, that's working fine.
  When I look at the wireframe it's like this</p>
  
  <p><img src="https://i.stack.imgur.com/cdgl7.jpg" alt="wireframe"></p>
  
  <p>and with the wireframe turned of it looks like this</p>
  
  <p><img src="https://i.stack.imgur.com/xqlaz.jpg" alt="solid"></p>
  
  <p>As you can see the are no shades and the distortion isn't visible when the wireframe is turned of.</p>
  
  <p>What I'm looking for is what to place in my custom fragmentShader.</p>
  
  <p>I used this</p>
  
  <pre><code>        // calc the dot product and clamp
          // 0 -&gt; 1 rather than -1 -&gt; 1
          vec3 light = vec3(0.5,0.2,1.0);
  
          // ensure it's normalized
          light = normalize(light);
  
          // calculate the dot product of
          // the light to the vertex normal
          float dProd = max(0.0, dot(vNormal, light));
  
          // feed into our frag colour
          gl_FragColor = vec4(dProd, dProd, dProd, 1.0);
  </code></pre>
  
  <p>But that just creates a very ugly false light.
  Any ideas anybody?</p>
  
  <p>Thanks in advance,
  Wezy</p>