<p>"decent" is quite subjective and if you are restricting the capture to certain types of surfaces and controlled lighting conditions. For example normals and other <a href="https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function" rel="noreferrer">SVBRDF</a> parameters for shiny metallic surfaces are very difficult to capture compared to non-metallic, matte and bright surfaces without texture.</p>

<p>There are tools proposed in comments (<a href="http://www.crazybump.com/" rel="noreferrer">CrazyBump</a>, <a href="https://github.com/kmkolasinski/AwesomeBump" rel="noreferrer">AwesomeBump</a>) that try to do what you ask for and may generate normal maps sufficient to your requirements, but you could argue how "decent" the results are and how robust these tools are in capturing different types of surfaces. I don't know about the algorithms these tools use, but I believe they use more of an "artistic" than robust/accurate methods in generating the results.</p>

<p>There is some recent work to estimate normal map and other SVBRDF parameters using <a href="https://mediatech.aalto.fi/publications/graphics/TwoShotSVBRDF/" rel="noreferrer">two images</a> or from a <a href="https://mediatech.aalto.fi/publications/graphics/NeuralSVBRDF/" rel="noreferrer">single image</a> (using neural networks), which is probably your best bet. However these algorithms assume a level of repeating pattern in the input images, but this might be ok for you since you mention rock wall as an example. There are likely other constraints as well such as requiring the captured surface to be dielectric hard surface material.</p>

<p>For more robust SVBRDF capturing you can check paper on <a href="https://mediatech.aalto.fi/publications/graphics/FourierSVBRDF/" rel="noreferrer">frequency domain capture</a>, but this is more complex capturing setup and far from a single image capture.
<a href="https://i.sstatic.net/Z80R5.png" rel="noreferrer"><img src="https://i.sstatic.net/Z80R5.png" alt="enter image description here"></a></p>

<p>To my knowledge there's no known generic algorithm to accurately extract SVBRDF parameters from a single image of a non-repeating surface because of the fundamental issue that a single image can't unambiguously represent SVBRDF parameters. E.g. two different normal &amp; albedo combinations of a <a href="https://en.wikipedia.org/wiki/Lambertian_reflectance" rel="noreferrer">Lambertian surface</a> may result in same pixel color in a single image.</p>

CC BY-SA 3.0
2017-06-17T16:09:59.873Z
I'll make sure to check out the mentioned neural network approach. I guess I'll have to go back to messing around with custom image filters, considering you mentioned that those applications use artistic approaches rather than super accurate models of light transfer.
Daniel Kareh
CC BY-SA 3.0
2017-06-17T08:11:39.670Z
2017-06-17T08:11:39.670Z
JarkkoL
<p>How does one go about taking a single photograph, like a picture of a rock wall, and getting a decent normal map out of it?</p>

<p>If you can, I'd like to learn about the mechanics behind it, and not a piece of software like CrazyBump that does it for me.</p>

CC BY-SA 3.0
2017-06-15T01:44:10.347Z
Any reason you're limiting yourself to a single texture? I've seen it done with multiple textures in shipping apps. (Not to say it can't be done with a single texture, but my guess is that it's easier with more than 1 texture.)
user1118321
CC BY-SA 3.0
2017-06-15T02:34:37.913Z
It's easier to get a single texture. And, I'm curious :)
Daniel Kareh
CC BY-SA 3.0
2017-06-15T02:42:07.420Z
@DanielKareh: "*But how does one go about taking a single texture and getting a decent normal map out of it?*" What makes you think that there's a way to convert an image into a normal map? What is the image of, exactly?
Nicol Bolas
CC BY-SA 3.0
2017-06-15T05:47:50.190Z
try reading this: https://fenix.tecnico.ulisboa.pt/downloadFile/845043405449073/Tangent%20Space%20Calculation.pdf
Charlie
CC BY-SA 3.0
2017-06-15T13:05:47.993Z
@NicolBolas: Well, software like CrazyBump seems capable of generating normal maps of many, many surfaces from a single texture.
Daniel Kareh
CC BY-SA 3.0
2017-06-15T13:06:35.593Z
@trichoplax: Sorry if my question was confusing. I'm looking for a way to generate a decent normal map from a single texture, if that's possible.
Daniel Kareh
CC BY-SA 3.0
2017-06-15T13:08:59.300Z
@Charlie: I already know how to use a normal map and apply it to a surface. I'm trying to learn how to get the normal map in the first place.
Daniel Kareh
CC BY-SA 3.0
2017-06-15T13:46:57.660Z
There are several  different ways to do this, easiest being converting a bump map into a normal map.
joojaa
CC BY-SA 3.0
2017-06-15T14:16:10.877Z
@joojaa: Alright. Any ideas on how to get a bump map from an image?
Daniel Kareh
CC BY-SA 3.0
2017-06-15T14:39:06.967Z
If the image is a bump map then the normal map is just the derivate of the bump.
joojaa
CC BY-SA 3.0
2017-06-15T14:43:17.323Z
@DanielKareh aha, I just use mudbox myself. You generate a normal map from a bump map.
Charlie
CC BY-SA 3.0
2017-06-15T15:00:28.350Z
But, how do I get the bump map from the image. Like, if I have an image texture of say, a rock wall, how can I get a decent bump map from it, which I can then convert into a normal map.
Daniel Kareh
CC BY-SA 3.0
2017-06-15T17:29:21.393Z
@trichoplax: Yes, that is correct. I'll edit the question.
Daniel Kareh
CC BY-SA 3.0
2017-06-15T17:29:58.677Z
Hopefully someone can give an overview explanation as an answer here, but as a starting point there is a free open source tool called [AwesomeBump](https://github.com/kmkolasinski/AwesomeBump) if you (or anyone looking to write an answer) wants to see example code.
trichoplax is on Codidact now
CC BY-SA 3.0
2017-06-15T18:00:20.633Z
Thank you! Do you happen to know which file the generator is in, or will I have to look around?
Daniel Kareh
CC BY-SA 3.0
2017-06-17T09:06:02.857Z
I'm afraid I'm not familiar with the software, just stumbled upon it while searching.
trichoplax is on Codidact now
CC BY-SA 3.0
2017-06-17T16:11:04.613Z
That's okay. I'll make sure to do some searching through the files.
Daniel Kareh
<texture><normal-mapping>
How are Normal Maps created?
Daniel Kareh
# How are Normal Maps created?

(Asked by: username_0 on 2017-06-14)

How does one go about taking a single photograph, like a picture of a rock wall, and getting a decent normal map out of it?

If you can, I'd like to learn about the mechanics behind it, and not a piece of software like CrazyBump that does it for me.

**Tags:** texture, normal-mapping

> **Comments:**
> **username_1**: Any reason you're limiting yourself to a single texture? I've seen it done with multiple textures in shipping apps. (Not to say it can't be done with a single texture, but my guess is that it's easier with more than 1 texture.)  
> **username_0**: It's easier to get a single texture. And, I'm curious :)  
> **username_2**: @username_0: "*But how does one go about taking a single texture and getting a decent normal map out of it?*" What makes you think that there's a way to convert an image into a normal map? What is the image of, exactly?  
> **username_3**: try reading this: https://fenix.tecnico.ulisboa.pt/downloadFile/845043405449073/Tangent%20Space%20Calculation.pdf  
> **username_0**: @username_2: Well, software like CrazyBump seems capable of generating normal maps of many, many surfaces from a single texture.  
> **username_0**: @username_5: Sorry if my question was confusing. I'm looking for a way to generate a decent normal map from a single texture, if that's possible.  
> **username_0**: @username_3: I already know how to use a normal map and apply it to a surface. I'm trying to learn how to get the normal map in the first place.  
> **username_4**: There are several  different ways to do this, easiest being converting a bump map into a normal map.  
> **username_0**: @username_4: Alright. Any ideas on how to get a bump map from an image?  
> **username_4**: If the image is a bump map then the normal map is just the derivate of the bump.  
> **username_3**: @username_0 aha, I just use mudbox myself. You generate a normal map from a bump map.  
> **username_0**: But, how do I get the bump map from the image. Like, if I have an image texture of say, a rock wall, how can I get a decent bump map from it, which I can then convert into a normal map.  
> **username_0**: @username_5: Yes, that is correct. I'll edit the question.  
> **username_5**: Hopefully someone can give an overview explanation as an answer here, but as a starting point there is a free open source tool called [AwesomeBump](https://github.com/kmkolasinski/AwesomeBump) if you (or anyone looking to write an answer) wants to see example code.  
> **username_0**: Thank you! Do you happen to know which file the generator is in, or will I have to look around?  
> **username_5**: I'm afraid I'm not familiar with the software, just stumbled upon it while searching.  
> **username_0**: That's okay. I'll make sure to do some searching through the files.  

---

## 1 answers

### Answer by username_6 on 2017-06-17. Score: 5 | Accepted answer

"decent" is quite subjective and if you are restricting the capture to certain types of surfaces and controlled lighting conditions. For example normals and other [SVBRDF](https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function) parameters for shiny metallic surfaces are very difficult to capture compared to non-metallic, matte and bright surfaces without texture.

There are tools proposed in comments ([CrazyBump](http://www.crazybump.com/), [AwesomeBump](https://github.com/kmkolasinski/AwesomeBump)) that try to do what you ask for and may generate normal maps sufficient to your requirements, but you could argue how "decent" the results are and how robust these tools are in capturing different types of surfaces. I don't know about the algorithms these tools use, but I believe they use more of an "artistic" than robust/accurate methods in generating the results.

There is some recent work to estimate normal map and other SVBRDF parameters using [two images](https://mediatech.aalto.fi/publications/graphics/TwoShotSVBRDF/) or from a [single image](https://mediatech.aalto.fi/publications/graphics/NeuralSVBRDF/) (using neural networks), which is probably your best bet. However these algorithms assume a level of repeating pattern in the input images, but this might be ok for you since you mention rock wall as an example. There are likely other constraints as well such as requiring the captured surface to be dielectric hard surface material.

For more robust SVBRDF capturing you can check paper on [frequency domain capture](https://mediatech.aalto.fi/publications/graphics/FourierSVBRDF/), but this is more complex capturing setup and far from a single image capture.
[![enter image description here](https://i.sstatic.net/Z80R5.png)](https://i.sstatic.net/Z80R5.png)

To my knowledge there's no known generic algorithm to accurately extract SVBRDF parameters from a single image of a non-repeating surface because of the fundamental issue that a single image can't unambiguously represent SVBRDF parameters. E.g. two different normal & albedo combinations of a [Lambertian surface](https://en.wikipedia.org/wiki/Lambertian_reflectance) may result in same pixel color in a single image.

> **Comments:**
> **username_0**: I'll make sure to check out the mentioned neural network approach. I guess I'll have to go back to messing around with custom image filters, considering you mentioned that those applications use artistic approaches rather than super accurate models of light transfer.  

---

