Jump to content
  • Advertisement
Sign in to follow this  
link3978

Normalmap vs bumpmap confusion

This topic is 3128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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! :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!