Home Technical Talk

Normal map question

polycounter lvl 11
Offline / Send Message
tekmatic polycounter lvl 11
Hi PC crowd,

I have a question concerning normal maps. I did search before hand on the PC forums, but did not find what I am looking for.

Basically I would like to know if there is a big advantage for using normal maps to replace bump maps. I understand how each are affecting the way light and texture information is displayed/seen.

In other words, can a normal map basically replace what the bump maps can do as well as use normal maps for detail work? I know I am not wording this properly :poly122: so let me know if my question is not clear.

Thanks in advance

Replies

  • PredatorGSR
    Options
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    Bump maps can only provide surface detail. Normal maps can provide surface detail, and in addition can provide normal information to describe a 3D shape. So they can do what a bump map does and more. With a normal map you can make a low poly object look like it is a high poly object if you create it correctly.

    Bump maps aren't really used in modern game engines anymore except for specialized cases, because normal maps do the same thing and are much more versatile.
  • tekmatic
    Options
    Offline / Send Message
    tekmatic polycounter lvl 11
    Thanks Predator for your response. I was not sure if bump mapping is used at all in next gen game creation, but makes sense if the normal maps can give you what bump does plus more.
  • eld
    Options
    Offline / Send Message
    eld polycounter lvl 18
    And bumpmaps are most often converted to normalmap at runtime since normalmaps are handled much faster.

    So yes, with normalmaps you can do what you could with bumpmaps, but with more control.
  • megalmn2000
    Options
    Offline / Send Message
    megalmn2000 polycounter lvl 13
    And the normal map can give you more height illusion than the bump map.
    Bump map are grayscale, so you have only 256 level of height.
    Normal map are colorful, so you can have 16,4 millions of level of height. :)
    If I'm not correct, please just reply to this.
  • mdeforge
    Options
    Offline / Send Message
    mdeforge polycounter lvl 14
    http://en.wikipedia.org/wiki/Normal_mapping


    "In 3D computer graphics, normal mapping is an application of the technique known as bump mapping. While bump mapping perturbs the existing normal (the way the surface is facing) of a model, normal mapping replaces the normal entirely. Like bump mapping, it is used to add details to shading without using more polygons. But where a bump map is usually calculated based on a single-channel (interpreted as grayscale) image, the source for the normals in normal mapping is usually a multichannel image"
    I always thought RGB normal maps were more accurate than a greyscale heightmap (bump map) because each pixel actually stores a vector for the high-detail surface's angle, rather than just a height-difference.
    I don't know much about the tech though... I just imagined RGB normal maps to be a more accurate depiction of the highpoly surface in relation to the lowpoly one.

    -From MoP in this thread
  • equil
    Options
    Offline / Send Message
    normal maps are higher resolution at the same resolution. (゜∀。)
    normal maps = x^2 normals.
    bump maps = (x-1)^2 normals.
  • EarthQuake
    Options
    Offline / Send Message
    When talking about accuracy in normal maps we basically have 2 separate issues to consider.

    1. Accuracy as it pertains to bit depth, comparing a 8bit image to a 24bit image, sure you would instantly say the full color image has more accuracy. However, we fail to consider that a tangent space normal map, being the mostly-blue beast that it is, is hardly using the full range of information available to it. It still has a relatively small window of data it can use to represent height differences.

    Normals/Bumps are also of course limited to the same resolution, same amount of pixels. So there really isn't a big difference when it comes to detail or bit depth accuracy between the two, and infact normal's poor compression habits highlight just how small of a range the image actually uses. So, this isn't really why we use normal maps over bump.

    An object/world space map uses more range of the color, but it is in non-relative space, IE: specific colors always mean specific directions. A bump map is always relative to the surface, meaning each pixel could theoretically represent 256 different values.

    Now, the second way in which we talk about accuracy is in regards to data baked from a mesh.

    This is where normal maps are really helpful, as we can take very accurate geometric source data, and project this onto uv space and save it as an image. Details are projected accurately despite UV distortion and the low poly mesh normals being able to be replaced entirely are of course the main benefits here. With a properly sync'd up baking workflow, we can accurately replace the mesh normals of the low resolution model with those of the high.

    Bit depth doesn't have a whole lot to do with this sort of accuracy. The point here is normal maps that replace a meshes normals entirely are often baked from a source, and a bump map painted by hand is only going to alter the normals relative to the exsisting normals. Meaning you'll never get that highpoly look by simply painting a bump map by hand, as you'll never be able to accurately account for the lowpoly's mesh normals/smoothing by hand.

    This is the biggest reason why baking from a high res mesh is the preferred/common way to go about doing things.
  • EarthQuake
    Options
    Offline / Send Message
    equil wrote: »
    normal maps are higher resolution at the same resolution. (゜∀。)
    normal maps = x^2 normals.
    bump maps = (x-1)^2 normals.

    For all practical purposes, a bump map, whether it is converted to normals via a tool like crazybump/nvidia plugin, or at runtime, its just the means to an end. Which is of course a normal map, so they are both normal maps and are both limited to the same resolution, when all is said and done.

    Unless i'm missing something here.
  • tekmatic
    Options
    Offline / Send Message
    tekmatic polycounter lvl 11
    EarthQuake, thanks a lot man.....this is now a lot more clear to me. I wonder why my 3d classes never really bothered to explain this the proper way.

    Also thanks to all the responses people. I am definitely more informed now :poly142:
  • Arcanox
    Options
    Offline / Send Message
    tekmatic wrote: »
    EarthQuake, thanks a lot man.....this is now a lot more clear to me. I wonder why my 3d classes never really bothered to explain this the proper way.

    Also thanks to all the responses people. I am definitely more informed now :poly142:

    You ought to wonder about everything your 3d classes teach you. If I didn't, I'd still be using edit mesh, box modeling EVERYTHING, and rigging my characters with physique.
  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    well wouldnt it be better to save unnormalized normalmaps , that way that the direction has the most acuracy, and then normalizing them on load time
  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    ah right, i forgot about compression
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Another reason we use normal maps is because the r, g, and b channels are all 8 bits so it makes a 24 bit image for the cost of an 8 bit image. With a bump map you'd need to make a 24 bit grey scale image to get rid of any banding created by gradients in your bump/normal map. For example do a high to low transfer on a cylinder and output a bump map rather than a normal map and you'll get a lot of banding, plus for a game then you'd need to compress that further and introduce even more banding.
  • EarthQuake
    Options
    Offline / Send Message
    malcolm wrote: »
    Another reason we use normal maps is because the r, g, and b channels are all 8 bits so it makes a 24 bit image for the cost of an 8 bit image. With a bump map you'd need to make a 24 bit grey scale image to get rid of any banding created by gradients in your bump/normal map. For example do a high to low transfer on a cylinder and output a bump map rather than a normal map and you'll get a lot of banding, plus for a game then you'd need to compress that further and introduce even more banding.

    Again this isn't really a bit depth issue, bump maps introduce banding because they represent height, and normal maps represent direction, so on a slope, every pixel in your bump map would need to represent a step of the gradient, however in a normals map it can simply represent a direction.

    bumpnormalslopes.jpg

    Tangent space normal maps hardly use the fuill range, with the blue channel only really using the top 128-256 range, and the red and green using the middle range around 128 more than the upper and lower ranges. So its not simply a matter of X has better bit depth than Z, its X stores data in a completely different manner than Z. You can represent the data more accurate with less range when using a normal map, but this isn't because a normal map has more bit depth.


    Another interesting tidbit on compression, video cards do not support 8bit compressed images, so while you may think your grayscale bumpmap(or spec map!!!) is 1/3rd the size of a 24bit normal/color spec map, its actually not. A compressed 24 bit image is 1/4th the size, and a greyscale image is only 1/3rd the size, so speaking from memory usage, unless you can pack multiple grayscale maps into a single 24 bit image, you're not saving any memory by going greyscale.

    Also, if you pack a grayscale spec into the alpha of your diffuse, your compression ratio is 2:1, or the exact same amount of memory it takes to use 2 full size 24 bit images, so craming greyscale spec into the alpha and losing color information is always a bad idea.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Wait, I swear I've seen bump maps that have smooth gradients from a high to low transfer, are you saying this is not possible because the way a bump map has to store curvature in height space only? (embarrassed by my assumption of that's the case)
  • EarthQuake
    Options
    Offline / Send Message
    Normal maps have gradients to account for smoothing on the low poly's mesh normals yeah, maybe I should have said something more like "bit depth isn't the only advantage" as bit depth is an advantage with normals. Just that its not a straight up comparison of bit depth, if that makes any sense.

    Curved surfaces and gradiation to account for smoothing are good examples of where the extra bit depth comes into play, but the diamond example above is more of a best case worse case example, IE: where you need heavy gradiation in a bump map, compared to basically a few colors to represent the angles in a normal.

    I dont know how productive it is to compare things like smoothing compensation in normals VS bump, as you'll never try to paint that by hand with a bump map.
  • EarthQuake
    Options
    Offline / Send Message
    dont mind per, he must have missed his morning bath and pudding

    oh also i think I misread your last post malcom, i'm confused now.
  • Bal
    Options
    Offline / Send Message
    Bal polycounter lvl 17
    EarthQuake wrote: »
    Also, if you pack a grayscale spec into the alpha of your diffuse, your compression ratio is 2:1, or the exact same amount of memory it takes to use 2 full size 24 bit images, so craming greyscale spec into the alpha and losing color information is always a bad idea.

    Allows for one less file call though, which is not always negligible (but yeah usually more interesting for stuff that is grayscale anyways, like gloss map or height map).
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Bwaaaaaaaaaaaa, I'm confused now and I just realized your not EQ while I was typing this because you have the same avatar as him. Strictly speaking let's say you are doing a high to low transfer, no hand painting of any kind and no dxt for games, would it be true that you'd choose a normal map as the exported images because it stores curvature better?
  • EarthQuake
    Options
    Offline / Send Message
    Bal wrote: »
    Allows for one less file call though, which is not always negligible (but yeah usually more interesting for stuff that is grayscale anyways, like gloss map or height map).

    Right, this is generally an issue when your shader is already making lots of texture calls, in which case limiting the number of files can be key, I was speaking purely in terms of vram used.
  • EarthQuake
    Options
    Offline / Send Message
    malcolm wrote: »
    Bwaaaaaaaaaaaa, I'm confused now and I just realized your not EQ while I was typing this because you have the same avatar as him. Strictly speaking let's say you are doing a high to low transfer, no hand painting of any kind and no dxt for games, would it be true that you'd choose a normal map as the exported images because it stores curvature better?

    Generally speaking, the only time you'de use bump is for ease of use when authoring, like stuff that is really easy to paint in 2d, complex designs and patterns.

    If you're baking from high you will always use normals, as bump is converted to normals anyway. There is never a situation where you'de use a bump from baked geo(unless it is for displacement/paralax, then its a "height map"), because its all normals in the end.

    This is what per is getting at.

    Bump/displacment maps also tend to be in a sort of "optimized" state, IE: use the max range of the image as possible, and then tweak the % via a shader paramater. It would be very hard to get an accurate bake from a bump map, I think basically impossible. Normal maps have fixed values as far as the angles they represent.

    Also, a baked bump/height map would never compensate for the gradiation/normals/curvature of the lowpoly mesh normals, it would only ever compensate for the height difference between the high and low, meaning the only possible use would be displacement/parralax. As a bump map will never compensate for smoothing errors like a normal map does.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Right but what is the reason you'd never use a bump when baking from high to low, I was under the assumption we didn't do this because it yields artifacts that are not present when generating a normal map from high to low.
  • EarthQuake
    Options
    Offline / Send Message
    EarthQuake wrote: »
    Also, a baked bump/height map would never compensate for the gradiation/normals/curvature of the lowpoly mesh normals, it would only ever compensate for the height difference between the high and low, meaning the only possible use would be displacement/parralax. As a bump map will never compensate for smoothing errors like a normal map does.
    Read the last paragraph there, I think i was editing while you type that response^^^^


    A real quick way to test this, would be to generate a height map from a complex model and assign that as a bump map on your mesh, you'd get all sorts of nasty artifacts because you're applying a displacement as bump essentially, not because of anything to do with bit depth precision, just the fact that these are two entirely different sets of data. One represents height, the other direction.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Great perna, this makes perfect sense to me, I think. So we're using normal maps because heights are rendered as normal maps at the end of the day any ways and therefore at render time artifacts and precision issues are introduced during the conversion. Right?
  • EarthQuake
    Options
    Offline / Send Message
    Yes that is correct, however it is only part of the issue. Using bump as normals in the way you've described(baked from geometry) just simply isnt possible.

    Lets take a look at this:
    normbumpcube_01.jpg

    Here we see high, low + baked normal map, and low + baked hieght map converted to normal map.

    The normal map works perfectly, because a baked normal map is:
    A direct comparison of the differences in the normal direction between the high and the low poly mesh.

    However a height map is:
    A direct comparison of the differences in the height direction between the high and the low poly mesh.

    The normal map does exactly what it should, replaces the lowpoly's normals with the normal direction of the highpoly mesh.

    Now, you see that the height information is completely a different set of information from that of the normals, so you get all sorts of problems, this has less to do with "accuracy" of bump vs normal than it does with the data you're generating the information from, and has absolutely nothing to do with bit depth precision

    normbumpcube_02.jpg.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Right, so there's no way to convert a height map to a normal map without degrading the quality, hence we just skip that step and go directly to normal map. But why convert your height map to a normal map and flatten it out, why not just let the video card render it. Unless I'm missing something you can use a high to low bake to simulate curvature with a bump but it's got a lot of banding in it so it's not practical, as well Maya can't export a 24bit heightmap as far as I can tell so it's not even a possibility. And on top of that you would get some discrepancies from the render converting your height map into a normal map.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    I'm just looking at EQ's height to normal example and that's an extreme case I don't get that flattening effect when I generate height map from a high to low but I do get all this shitty banding hence my confusion about the issue and why I thought it was a bit depth issue. I've confirmed the height map generated is actually banded not an artifact created at render time.

    hightolowbump.jpg
  • EarthQuake
    Options
    Offline / Send Message
    Its very important to realize you're literally just projection onto flat planes here, so it isn't a realistic test at all. Mine was the worst case scenario(a box with no hard edges) but every mesh is going to have some smoothing that needs to be accounted for, which a bump->normals workflow will never be able to do correctly.

    Also, I use floaters on some areas to highlight the various drawbacks of the method if it really were feasible at all. You could of course edit the hieght map to limit that, but what is the purpose, you're doing a lot of work when the proper way is just staring you in the face.

    Bit depth and banding and all of these are issues(they are issues with normal maps too in some cases) but its so far down the list of real problems that its not worth discussing. Again, the reason we dont bake height maps and convert them to normal maps is not banding, but the fact that you will never accurately replace a mesh's normals from a generated height map, it just doesnt work. And this is the entire point of using normal maps, to replace the mesh normals with that of a more detailed source. If we could export 32bit per channel bump maps that solved the problem of banding, we still wouldn't be able to use a bump map as a replacement for normals, as a bump map does not contain normal information and can not compensate for smoothing.

    When we realize that all bump maps are necessarily normal maps, bump maps offer absolutely no benefit, except for content that is easier to paint in 2d.
    malcolm wrote: »
    But why convert your height map to a normal map and flatten it out, why not just let the video card render it.

    The real question is why *wouldn't* you? We've already covered the fact that bump maps are basically inferior in every way, even using more VRAM than a normal map.... Why would you ever want to do this?
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Interesting stuff great to know all this.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    I don't actually want to do this I was just wondering if it was possible in relation to the differences between bump vs normal.
  • tristamus
    Options
    Offline / Send Message
    tristamus polycounter lvl 9
    Fucking awesome convo, guys...lol. Just went through it all = Profit.
  • G3L
    Options
    Offline / Send Message
    G3L polycounter lvl 9
    LOL just read through this stuff....this is the type of stuff that doesn't get talked about at times which IS pretty damn important to know. Thanks!
Sign In or Register to comment.