   Environment mapping using deferred lighting?
  I'm currently trying to implement deferred lighting in a project and in the current version I'm able to use a normal pass and a diffuse pass to achieve phong shading with a number of point lights. Next up will be to environment map it using the same normal pass. I want to do it kind of like this:vec3 n = texture2D(normalMap, texCoord).xyz;vec3 Nn = normalize(n * 2.0 - 1.0);vec4 environmentColor = vec4(textureCube(environmentMap, Nn));The Nn is doing the job when calculating the phong shading, but in this case, the resulting environmentColor is completely wrong. It should be the same as "Environment mapped Bump mapping" (EMBM) and I'm pretty positive I'm in the wrong coordinate space but since I'm basically drawing it to a full screen quad, in my opinion, the tangent, binormal and normal matrix will then be the identity matrix. I'm getting the feeling I'm doing some really basic mistakes but I just can't see them right now. It would be really helpful if someone could give me some pointers.Thanks   
  I think for "Environment mapped Bump mapping" you need not normal but reflection vector - view_position to fragment position vector reflected around normal.in HLSL:float3ViewVector = normalize(view_to_world[3].xyz - input.world_pos);float3 ref = reflect(-ViewVector, Nn);float4  environmentColor = float4(texCUBE(environmentMap, Nn));;  You're absolutely right. This is true when you want reflections but in my case (which I didn't write in the first post) I want to project a diffuse convolution map onto the surface. Then you want to use the normal instead of the reflected light. Unfortunately, even when using the reflected light, I only get a slightly different pattern from when I use the normal. But it's still not right. I will post a screenshot later today that might help.   ;  I rewrote the code that loaded the cube map and now it has mysteriously started to work. Thanks anyways :)   