title: GLSL lighting- Attenuation based on a light radius
body: <p>So ive been working on lighting, and for the purpose of shadow mapping i did light attenuation based on radius instead of the three attenuation factors (Constant, Linear and quadratic) and, well... It doesn't look very nice near the edges.</p>
  
  <p><a href="http://i.stack.imgur.com/H680a.png" rel="nofollow">http://i.stack.imgur.com/H680a.png</a></p>
  
  <p>It cuts off very rapidly, and the shader code looks like this...</p>
  
  <pre><code>#version 330 core
  
  //FragPos = world-space position of current fragment (vec3)
  //light.radius is a float.
  vec3 distance = (light.pos - FragPos) / light.radius;
  float attenuation = 1.0f - dot(distance, distance);
  </code></pre>
  
  <p>So how should i go about making it look not-terrible? For example,
  <a href="http://i.stack.imgur.com/B3QZo.png" rel="nofollow">This</a></p>