To do normal mapping in Deferred Rendering is little dificult because you need to store in G-buffer tangent and binormal if you want, but it is easy to calculate. Or you can calculate TBN matrix per pixel with your 2D normal map stored in G-buffer. So I can’t do that because have high GPU consumption.
Other thing that you can to do is store in 8bit the result of “light power” calc in Geometry stage and then, use that in Lighting Stage. But “normal mapping” will be based in 1 light.
Anyway, we can do an approximation using a bling phong lighting and fast normal mapping calc:
// Calculate half vector vec3 H = normalize( normalize(lightDirection) + normalize(eyePosition.xyz - pixelPosition.xyz)); // Calculate phong shading float shininess = 100.0; vec3 phong = pow(max(dot(H, normal.xyz), 0.0), shininess) * specular.rgb; // Calculate normal mapping effect float lightAmount = max(dot(normal.xyz, normalize(lightDirection)), 0.0);