   Normal Map Creation
  Hello,I will reply to my own retired topic (which you can findhere ), because Mr. Ashikhmin himself posted me a PM with some VERY useful information. They might be useful to other people as well and I also want to present some results :)I was working on one of his papers (link ) from the year 2000 in order to extract geometric information from of a set of 6561 input images, called BTF (bidirectional texture function). At some point I got stuck and posted to gamedev.net, but did not get an answer for months.Mr. Ashikhmin then sent me a link to one of his unpublished papers (link), which deals with the same matter but seems to be less difficult to implement. The paper deals with the creation/extraction of Normal Distribution Functions (NDF). At any point of a surface, the NDF describes the orientation of a normal in dependence of the incoming ray (light) and an outgoing ray (view). I used parabolic mapping to project those four dimensions down to two dimensions. The lower image shows three examples of parabolic NDFs. For those still familiar with old-school demo-scene tricks, those maps can be imagined as "Phong Lookup Tables" on a per-pixel basis.It is now possible to evaluate the average orientation of the pixel's normal from the parabolic map. If you do this for each pixel, you get very detailed normal maps (notice the pattern of the wallpaper) you can use in games, for example.  One last remark: This is no new stuff, it has been done before. I am still working on it, because there are several issues and problems I did not mention in this reply.
  Looks pretty cool, thanks for sharing. I did have a look into the original published paper a year or so back; but I couldn't find a use for it at the time so shelved it. Maybe I'll dig it out again...Quote:there are several issues and problems I did not mention in this replyAny hints as to what these are?Cheers,Jack   ;  hello jack, thanks for your interest! well, first of all the alignment of the normal map and the actual underlying geometry might suffer from imprecision. by imprecision I mean a translation in the range from 1mm up to 3mm. how to deal with this error is decribed in this paper (which I am currently trying to implement).another point is, if you take a closer look at the normal map of the floor tiles, you see some irregularities at the grooves of the material. too small resolution of the input images might be one reason for this. another reason might be insufficient sampling of my parabolic maps. Currently, I am implementing a push-pull image-algorithm to cope with this problem.also, imagine the amount of memory that would be necessary to store 256x256 normal  distribution maps! I store each of them them with 32x32 pixels, but 256x256 pixels would be better. It is unpractical to deal with such an amount of texture maps.therefore, some sort of clustering has to be applied to the sampled materials. example: imagine the material wool. wool is made of small, macroscopic strings. each string is pointing to a certain direction, some strings are visible and some are not, but in the end it's just ONE string (and maybe the "dark gap" between two strings). so if done right, you have to store only two NDFs. but, in order to restore the original material, you have to know how the string were orientated before the clustering. thats actually one field of current research.