   NormalMap Theory
  i need a dynamic solution for bumpmapping and i dont want to recalculate the tbn matrix...my theory- calculate TBN once- transform normal of the normalmap with this TBN into object space- transform light into object space by the inverse modelview matrix-> so every data is static...is there a mistake in my theory? why do most peopple transform the light into tangent space (this would mean after an object rotation i have to recalculate the TBNmatrix)? is my approach correct?   
  I think that your theory is a bit flawed, normally you don't need to recalculate the TBN matrix, unless your geometry changes somehow (but this doesn't mean rotation / translation)- It is a more expensive to transform every normal to object space by TBN matrix since the operation will be done for every fragment. You can transform the light to the tangent space.The theory:- TBN matrix usually transforms vectors from tangent space to object space so actually you'll need the inverse of the TBN matrix. The inverse TBN matrix will transform vectors from object space to tangent space.Per-vertex:- Transform light from world space to object space by inverse world matrix- Transform object space light to tangent space by the inverse TBN matrixPer-pixel- Light and normal are now in the same space (tangent space) - do what ever kind of lighting you wish.As you can see, the rotation of the object has been taken in account by the inverse world matrix.[edit]The normal must be in tangent space of course. So the same map can be used on some other objects too.[Edited by - Demus79 on June 2, 2006 7:39:19 AM];  if you`re going to do that you may as well use a tool like melody (somewhere on nVidia) to calculate the objectspace normal map for you. The reason most people don`t use this technique, even if it saves ALOT of space and calculation time is that when useing the actual texture you can only use it on one object, without reuseing texture space, because the object space normal depends on the objects shape. Nothing wrong with either way, I`m giving you the facts.   ;  perfect...clearer nowi hope this is no doublepost because the server is bugging around....   