Normalmap vs bumpmap confusion

Started by
6 comments, last by Krohm 14 years, 5 months ago
Hi all, I have been struggling learning the difference between bumpmapping and normalmapping for awhile now so I decided maybe someone here can better explain it to me. Is bumpmapping a texture that has tangent space offset vectors? So to implement bumpmapping would be to add vertex normals to all the verticies in your mesh. Then, in your shader, transform the vertex normals to tangent space. And finally, add the tangent space offset vectors that are in the bump map texture to the transformed vertex normal? Is normalmapping a texture that has the base normals? So to implement this, in your shader you look up the normal in the normalmap texture given vertex UV coordinates thus you don't need to have vertex normals? Those words are used so interchangeably that I get confused very easily when I read about either one. Also, I have a mesh of a person's face but I only have position and UV coordinates for each vertex. I also have a diffuse texture of the person's face. I was wondering if there was a way to generate the base normals (not offsets, since I don't have any base normals) from the diffuse texture. I'm pretty sure there are tools (e.g. nvidia's normalmapping photoshop plugin) that do this but since bumpmapping and normalmapping have me confused, I'm not sure if a certain tool does what I want. Thanks for any help! :)
Advertisement
You always need vertex normals. Normal-maps are in tangent-space, and dependent on the vertex-normals. Bumpmaps and normalmaps are the same thing.. though sometimes bumpmap is used to describe a black and white heightmap texture, while normalmap is the texture containing the normal directions.
Thanks for the reply Erik

So a normalmap/bumpmap is just a texture that has tangent space normal offset vectors?

Also, if you always need vertex normals like you mention, then to get unfaceted (smooth) looking meshes, you have to use weld/smoothing group techniques? I know how to use weld/smoothing groups in 3ds max to get a mesh to look smooth but when I heard of normalmapping, I figured it was a way get around welding/smoothing groups and by just using a texture lookup. But then I couldn't figure out how to generate the normals from a diffuse texture which as it sounds, maybe impossible if you always need vertex normals.
Bump Mapping means perturbing the surface properties (usually just the normal) at per-pixel level according to some textures, to simulate bumps or rough material imperfections.

Normal Mapping is the simplest form of Bump Mapping.

There exist more complex ways to implement bump mapping, which achieve greater results, for example Parallax Mapping and Relief Mapping.

Nowadays normal mapping is the entry-level bump mapping, and every engine has it. Parallax mapping is widely used because it increments the grade of realism without slowing the shader too much. Relief mapping, and Cone Mapping, lead to almost perfect results but are kinda slow.

---

The bump map is a texture which defines the height of the elements.
The normal map is derived from the bump map, and specify only the normals of the elements (not the height anymore).

Normal Mapping requires only the normal map.

Parallax, Relief and Cone mapping, require both the maps.

Usually, the normals in the normal map are stored in tangent space, which is the better way to store normals in order to obain scalability and indipendence from the formats.

---

To implement normal map, you have to save the tangent base at each vertex, and then interpolate it.
Tangent space means normal, tangent and bitangent vectors of the vertex.
However, it's suggested to compute either the tangent or the bitangent at shader level, to decrease the amount of memory required, so the band.

---

hope it helps ;)
I just wanted to add that you can in fact do normal mapping without a tangent space as described in the original post. This is usually called model space normal mapping; the normals are assumed to already be in the model's space and are used directly without transformation.

It's not used often because it's very limiting (the normal map is dependent on the orientation of the model so you can't rotate it without recomputing the normals). But it can be useful for some things e.g. terrain.
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
Thanks for all the replies.

Now I think I get it.

So bumpmapping and techniques to implement it (normal/parallax/relief) are all ways to perturb the surface (make it look bumpy). But you always have to save some sort of base normal per vertex (in tangent space, or model space) and with bumpmapping techniques you can perturb this base normal per vertex which makes your mesh look bumpy.
Quote:Original post by link3978
with bumpmapping techniques you can perturb this base normal per vertex which makes your mesh look bumpy.


better, you take this normal and interpolate it through all the fragments. Once here, at fragment level, you use your bump-data (that can be the new normal, or also the "height" of the fragment) to compute the light values.
Quote:Original post by link3978
So bumpmapping and techniques to implement it (normal/parallax/relief) are all ways to perturb the surface (make it look bumpy). But you always have to save some sort of base normal per vertex (in tangent space, or model space) and with bumpmapping techniques you can perturb this base normal per vertex which makes your mesh look bumpy.
No way! You don't need just the normal!
It seems to me that you're missing your vector space basics.

Let's start from scratch. The tangent-space normal map. For the purposes of this discussion, Parallax algorithms are irrelevant (as they are really layered 'on top' of normal mapping). Whatever you use true normal maps or height maps is relatively irrelevant for this discussion since the two can be generated more or less easily from each other.

The tangent-space normalmap encodes vectors essentially by sitting on an arbitrary polygon assumed to be in canonical space and looking "out". The real poly on which the normalmap is going to be applied will have a texture space which won't typically be in the same space.
For this reason, you need a whole orthonormal basis to correctly xform your tangent-space normals. You may have heard about "normal", "binormal" and "tangent" vectors, which are essentially the vector space generators for a poly's xformed tangent space.

Personally I've felt just at home by replacing the whole normal, rather than perturbing it a-la offset approach, and if memory serves this is what McGuire does in his steep parallax shaders, together with countless others.

Previously "Krohm"

This topic is closed to new replies.

Advertisement