title: Why are my specular highlights elliptical?
body: <p>I think these should be circular. I assume there is something wrong with my normals but I haven't found anything wrong with them.  Then again, finding a good test for the normals is difficult.</p>
  
  <p>Here is the image:<a href="https://i.stack.imgur.com/oucTr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oucTr.png" alt="enter image description here"></a></p>
  
  <p>Here is my shading code for each light, leaving out the recursive part for reflections:</p>
  
  <pre><code>  lighting = ( hit.obj.ambient + hit.obj.emission );
    const glm::vec3 view_direction = glm::normalize(eye - hit.pos);
    const glm::vec3 reflection = glm::normalize(( static_cast&lt;float&gt;(2) * ( glm::dot(view_direction, hit.normal) * hit.normal ) ) - view_direction);
    for(int i = 0; i &lt; numused; ++i)
      {
  
        glm::vec3 hit_to_light = (lights[i].pos - hit.pos);
        float dist = glm::length(hit_to_light);
        glm::vec3 light_direction = glm::normalize(hit_to_light);
        Ray lightray(hit.pos, light_direction);
        Intersection blocked = Intersect(lightray, scene, verbose ? verbose : false);
        if( blocked.dist &gt;= dist)
          {
            glm::vec3 halfangle = glm::normalize(view_direction + light_direction);
            float specular_multiplier = pow(std::max(glm::dot(halfangle,hit.normal), 0.f), shininess);
  
            glm::vec3 attenuation_term = lights[i].rgb * (1.0f / (attenuation + dist * linear + dist*dist * quad));
            glm::vec3 diffuse_term = hit.obj.diffuse * ( std::max(glm::dot(light_direction,hit.normal) , 0.f) );
            glm::vec3 specular_term = hit.obj.specular * specular_multiplier;
          }
      }
  </code></pre>
  
  <p>And here is the line where I transform the object space normal to world space:</p>
  
  <pre><code>*norm = glm::normalize(transinv * glm::vec4(glm::normalize(p - sphere_center), 0));
  </code></pre>
  
  <p>Using the full phong model, instead of blinn-phong, I get teardrop highlights:</p>
  
  <p><a href="https://i.stack.imgur.com/kwynY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kwynY.png" alt="enter image description here"></a></p>
  
  <p>If I color pixels according to the (absolute value of the) normal at the intersection point I get the following image (r = x, g = y, b = z):
  <a href="https://i.stack.imgur.com/7LaNs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7LaNs.png" alt="enter image description here"></a></p>