   deferred shading and normal mapping
  I've been playing around with implementing a deferred renderer and so far have the basics working. I currently have depth, diffuse and normal buffers (gbuffer) and multiple lights with per-pixel shading. I'm creating my (gbuffer's) normal buffer using model's vertex normals. However, I was looking into normal mapping and was trying to think how it would be done with this type of rendering approach. From what I gather so far, when shading with normal mapping you transform the light's position to tangent space for each vertex and do computations based on that, in tangent space.Using deferred shading (the way I've implemented it anyway) all lighting computations are done in view space. I was thinking that if I had a normal map for a model (in object space), I would have to transform the normal at each pixel into world space when creating my gbuffer's normal buffer (meaning matrix multiplication per-pixel).Then I was thinking that it wouldn't work if the models were animated (mesh deformation etc.) so the normal map would have to be in tangent space and I would have to transform tangent space to view space when creating the gbuffer's normal map.Doing that kind of transformation on a per-pixel basis just to fill the normal buffer sounds very expensive but I haven't tried implementing this yet. I think I've only brushed lightly on the concepts so I thought I'd ask around to see if anyone has anything to contribute to the subject.Thanks,rasher   
  You've got it pretty much figured out. I calc my normals in view space by reconstructing the tangent frame. You can see all of the pain I went through here to figure it out haha... turned out i was using the wrong variable when calling the tangent_frame function... *palm to the face*..as for being expensive.... what shader model are you using? hardware that can support Def shading to begin with should be able to support pretty complex shaders.EDIT: I put to use the non-precomputed tangents chapter from ShaderX5... thanks wolf.. heh   ;  Transforming the tangent-space normals into view-space normals is not much worse than transforming the world/view-space lights into tangent-space, especially since it must be done only once (when rendering to the GBuffer).   ;  Thanks for the replies guys. I've been using shader model 2. I've put my deferred renderer aside for the moment and implemented normal mapping using my forward rendering approach. I now do my lighting calculations in tangent space. I think everything looks correct anyway.Screen1Screen2;  Yeah man looks pretty good... wish i was having the same success with my Point Light shader for my deferred renderer... posted about it a couple posts down.   