mrdoob/three.js — pull request #4553 by WestLangley (2014-03-09 03:07:37+00:00)
Title: Corrected calculation of reflection vector

We need to reflect the world-space view vector around the _world-space_ (perturbed) normal when using a bump/normal map with an environment map. Previously, we were reflecting around the _camera-space_ (perturbed) normal.

Converting the camera-space perturbed normal back to world space requires the equivalent of the "normalMatrix" for `camera.matrixWorld`. The shader does not have access to that matrix.

Instead, a technique is used that assumes orthogonality of the rotation component of `viewMatrix`. This assumption is satisfied if `camera.scale = ( 1, 1, 1 )` -- which it should be.

It would actually be a good idea, I believe, to find a way to prevent scaling of the camera matrix.