title: GLSL per pixel point light shading
body: <p><strong>VC++, OpenGL, SDL</strong></p>
  
  <p>I am wondering if there is a way to achieve smoother shading across a single Quad of geometry. Right now, the shading looks smooth with my point light, however, the intensity rises along the <code>[/]</code> diagonal subdivision of the face. The lighting is basically non-visible in-between vertices.</p>
  
  <p><img src="https://i.stack.imgur.com/Ea08R.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/4juE5.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/bY4Ll.jpg" alt="enter image description here"></p>
  
  <p><strong>This is what happens as the light moves from left to right</strong></p>
  
  <p>As I move the light across the surface, it does this consistently. Gets brightest at each vertex and fades from there.</p>
  
  <p>Am I forced to up the subdivision to achieve a smoother, more radial shade? or is there a method around this?</p>
  
  <p>Here are the shaders I am using:</p>
  
  <p><strong>vert</strong></p>
  
  <pre><code>varying vec3 vertex_light_position;
  varying vec3 vertex_normal;
  
  void main() 
  {            
      vertex_normal = normalize(gl_NormalMatrix * gl_Normal);
      vertex_light_position = normalize(gl_LightSource[0].position.xyz);
  
      gl_FrontColor = gl_Color;
      gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
  }
  </code></pre>
  
  <p><strong>frag</strong></p>
  
  <pre><code>varying vec3 vertex_light_position;
  varying vec3 vertex_normal;
  
  void main() 
  {
      float diffuse_value = max(dot(vertex_normal, vertex_light_position), 0.0);
      gl_FragColor = gl_Color * diffuse_value;
  }
  </code></pre>
  
  <p>My geometry in case anyone is wondering:</p>
  
  <pre><code>glBegin(GL_QUADS);
      glNormal3f(0.0f, 0.0f, 1.0f);
      glTexCoord2f(0.0f, 1.0f); glVertex3f(pos_x, pos_y - size_y, depth);
      glTexCoord2f(1.0f, 1.0f); glVertex3f(pos_x + size_x, pos_y - size_y, depth);
      glTexCoord2f(1.0f, 0.0f); glVertex3f(pos_x + size_x, pos_y, depth);
      glTexCoord2f(0.0f, 0.0f); glVertex3f(pos_x, pos_y, depth);
  glEnd();
  </code></pre>