6
$\begingroup$

I have an image like this:

enter image description here

I want to map it into a normal map, with black being lower parts and the white parts being raised. I tried this node map:

enter image description here

But its evidently not working. How can I convert a black and white image like this into a bump map?

$\endgroup$
4
  • 1
    $\begingroup$ @L0Lock ... any reason to delete Normal map and Image tags? Thanks $\endgroup$
    – vklidu
    Commented May 19, 2022 at 8:31
  • $\begingroup$ Because as you pointed out in your answer, this is more about how to treat the data to obtain heights info rather than normals and image data itself. $\endgroup$
    – Lauloque
    Commented May 19, 2022 at 11:15
  • $\begingroup$ @L0Lock I see, I just wanted to turn the image into a height map. Forgot the right term, oops! $\endgroup$
    – Aaron
    Commented May 20, 2022 at 3:33
  • $\begingroup$ No problem at all! In your case, @vklidu's answer has all what you need. Feel free to ask if you need clarification. $\endgroup$
    – Lauloque
    Commented May 20, 2022 at 7:11

2 Answers 2

19
$\begingroup$

Normal map colours describe pixel direction (surface angle) ... not a height. Black&white image like your represents pixel height.

It can be converted into something like normals, but it requires gradients interpolating height levels (like set a bit of blur). Your image represents only heights, but orientated at the same direction. Higher or lower squares on surface will be described in normal map by the same base violet color (it means flat).


What have you described sounds like you are looking for Height map?

Bump from Height ...

enter image description here

Displacement > type Bump from Height ...

enter image description here

Displacement > type Displacement as real geometry in render. Commonly called Micro-displacement ...

enter image description here For that effect you have to under Subdivision Surface modifier enable Adaptive Subdivision than you can in material setup switch Settings > Surface > Displacement type


Normal Map
If you are really looking for Height map to Normal map convert, check this Bake Normal ...

enter image description here enter image description here

... but as mentioned in first paragraph ... :)

$\endgroup$
2
$\begingroup$

When you use a grayscale image to simulate height, it's either called a displacement map or a bump map. There's nearly no difference between the two, beyond what they're used for. Because you're interested in using your image to change the normals, it's called a bump map. You're on the right track with your image, you're just doing a little bit too much. Here's the right-ish setup:

enter image description here

I didn't use a normal map node; bump mapping replaces normal mapping. It's a different technique to do the same thing, that has its pros and cons as compared to normal mapping.

Before I get any further, let me point a few things out. The first is that I set the distance to a very small number. The normals that a bump map node generates are the normals that you'd get if white meant a displacement of 1 Blender unit-- 1 meter, typically-- over black. For a cube that's only two units cubed, that'd be ridiculous. We're scaling it down here to centimeter level bump instead, by setting the distance to 0.01. Default distance is almost never a good idea.

The other thing is that your bump map doesn't look very bumpy, right? The normals are the only thing we're modifying. We're not getting shadowing from our bump. And the bump that you've provided is very solid, so what we're seeing are very sharp angles, which occupy nearly none of our visible cube. Neither bump mapping nor normal mapping are good for representing this particular displacement. I'd recommend loading this image into Photoshop or GIMP and running a blur on it, and then compare using the blurred bump to the original bump.

Finally, I set the bump map as non-color data. This means that if the image file contains a 0.5, that's halfway between black and white. In sRGB, it's not. Whether we want non-color or sRGB depends on how we made our bump map, but typically, bump maps are stored as non-color data, so we should read them that way. XYZ is not the same thing as non-color-- it is a different color space that is rarely used.

We can bake this to a normal map if we want. It won't be significantly different, but doing so will improve how some bump maps look under magnification. (It will also make them, and the mesh itself, harder to edit. That's the main tradeoff.) To do this, we can just bake normals to a new image, directly from this same material:

enter image description here

There's no need to do anything fancy; Blender bakes the normals of the shaders it's using. I created a new image + image texture node, on non-color, and made sure it was the actively selected node (white border), then set my bake type to "Normal" and hit the Bake button.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .