Hey guys,
I am working on creating normal maps from black and white images. Here is my source, it is just a test image:
Here is the normal that is generated out of it:
All good, except for the ridges/lines running around the indent/outdents in the map.
Not looking too good. Is there any way to fix this? I get this problem on generated maps from both nJob and Shadermap 2.
Thanks,
Benton
Replies
Take that first image that you're using as an input and just pass it through Heightmap->Normal. It'll look much cleaner. If you want to have a bigger angled area at the edges of your rectangles, blur your height map in Photoshop so the width of the blurred section matches the width of the angle you want.
All the heights are the same.
Normal maps don't have heights, they have angles.
If two surfaces are facing me, their normal (angle) is the same, so it doesn't matter if they are both the same distance from me, or if one of them is right in front of my face and the other one's on the other side of the sun -- their normal will be the same.
If you want to show something other than angle then you can use a displacement map. If you want to show more of an angle near the edges of the two surfaces then you can adjust your height map before you create your normal map (e.g. blurring it)
So why won't my heightmap be converted with the different height/angle values that it contains?
And on another note, I blurred part of the map in Photoshop, but I still get lines:
The lines will occur because of banding, so also try changing your height map to use all values from black to white rather than using lots of greys.
And sorry for all the noob questions, I just can't wrap my head around this at midnight.
I thought I could create a grayscale map in photoshop, and the ligher parts of the grayscale map would be raised more. But now I understand, the more of a blur the parts have, the higher/lower they are, it has nothing to do with shades of gray?
How do I remove the banding? Make it all black and white, no grey?
Again, sorry for all the questions. I just don't understand this stuff
Probably won't fix it entirely but may reduce the effect.
http://wiki.polycount.com/NormalMap/
The big thing about normal maps as you noted is that they are about angles. More specifically, they are about normal vectors; normal maps simply bend the normals of the existing geometry on a pixel level.
Here's a good example of visualizing normals being bent at extremes (the black spots)
http://f.hatena.ne.jp/images/fotolife/h/hajimeN/20071004/20071004101303.jpg
Or in your example using the photoshop plugin, the blue normals are all perpendicular, except at the square borders, where they would be angled like 30-something degrees. And back to 'flat' inside the square, since the shape only indicates a raised bevel.
The sphere shape would have a smooth transition of normal vectors from one side to the other across the profile.
For the banding, what are you using to view the results in? I use one program that gives similar results with .tga, but not .dds. You may need to calibrate your monitor, but midrange shouldn't be so affected by that. (could be a problem with this nJob tool? I've never used it)
It's not so much the blur, it's more the gradient. Blurring makes a gradient, but any gradient will do. If you remember from maths, a gradient is the change in height from one value to the next.
So imagine my height values are 1 2 3 4 5 6 7 8 9, my change in pixel height for each pixel will be 1 1 1 1 1 1 1 1 1. And if my pixel height values are 4 4 5 5 5 5 5 4 4 then my change in pixel height might be 0 1 1 0 0 0 -1 -1 0. That's basically what the red and green channels of normal maps are, though the numbers instead of being 0 for flat surfaces, they're 128.