title: GLSL cubemap reflection shader
body: <p>I'm developing OpenGL application and having problem implementing cubemap reflection shader: reflection rotates with camera around the object, it's is same from any point of view.</p>
  
  <p>Here is my vertex shader:</p>
  
  <pre><code>in vec4 in_Position;
  in vec4 in_Normal;
  
  out vec3 ws_coords;
  out vec3 normal;
  
  mat4 uniform_ModelViewProjectionMatrix;
  mat4 uniform_ModelViewMatrix;
  mat4 uniform_ModelMatrix;
  mat3 uniform_NormalMatrix;
  vec3 uniform_CameraPosition;
  ...
  ws_coords = (uniform_ModelViewMatrix * in_Position).xyz;
  normal = normalize(uniform_NormalMatrix * in_Normal);
  </code></pre>
  
  <p>And fragment:</p>
  
  <pre><code>uniform samplerCube uniform_ReflectionTexture;
  ...
  vec3 normal = normalize(normal);    
  vec3 reflectedDirection = reflect(normalize(ws_coords), normal);
  frag_Color = texture(uniform_ReflectionTexture, reflectedDirection).xyz
  </code></pre>
  
  <p>All shaders I found over the internet have same issue or producing weird results for me. </p>
  
  <p>I guess I need to rotate reflected direction with camera rotation but I have no idea how can I do that. On shader input I have world space camera position, MVP, MV, M and Normal matrices.</p>
  
  <p>Can you please help me implementing shader, that takes in account camera direction.</p>