Bump and Invironment Mapping

Started by
11 comments, last by Kest 18 years, 7 months ago
I'm totally new to bump mapping, and I'm getting a bit confused trying to get something working. Does bump mapping require an invironment map? Why so? Should I be using a sphere invironment map or a cube map? Does it matter if the polys belong to a wall or dynamic item or terrain? I know what invironment mapping does alone, but what does it do with bump maps? I can't seem to understand why they are needed to impliment bump mapping. I'm also a bit confused about the luminance attribute. Is the addition of luminance simply a better quality? Or an entirely different effect? There doesn't seem to be any sample programs using bump mapping, other than advanced pixel shader apps that only work in ref mode - basically they won't run with my card. I really appreciate any knowledge thrown my way.
Advertisement
hi there Kest, How are you doing buddy?

The Problem
What is Environment/ Bump mapping

The Solution

Environment Mapping
"Environment mapping is a technique that simulates highly reflective surfaces without using ray tracing. In practice, environment mapping applies a special texture map that contains an image of the scene surrounding an object to the object itself."

Bump Mapping
"Bump mapping is a special form of specular or diffuse environment mapping that simulates the reflections of finely tessellated objects without requiring extremely high polygon counts. Bump mapping implemented by Microsoft Direct3D can be accurately described as per-pixel texture coordinate perturbation of specular or diffuse environment maps, because you provide information about the contour of the bump map in terms of delta values, which the system applies to the u and v texture coordinates of an environment map in the next texture stage."

So basically it follows the following transformations and texture stage states.
Base Texture (Stage 0) -> Bump Map (Stage 1) -> Environment Map (Stage 2) -> Polygon


For further reading refer to
Bump Mapping in Direct3D

I hope this helps a bit buddy.
Take care.
Environment mapping is different from bump mapping, but they can be used together.

With bump mapping, you get the normal of a fragment from the bump map. The normal is used to determine the diffuse and specular lighting values. Without bump mapping, you interpolate the vertex normals to get the fragment's normal.

With environment mapping, you use the normal of a fragment to determine which texel in the environment map is reflected by that fragment. Without bump mapping, you interpolate the vertex normals to get the fragment's normal. With bump mapping, you get the normal from the bump map.

I'm not sure why they say, "Bump mapping is a special form of specular or diffuse environment mapping". That seems inaccurate to me since a bump map describes the surface being rendered and has nothing to do with the surrounding environment.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Bump maps perturb the visible normal of an object using a texture map. This can effect itself in shading differences for regular light sources, and if the object is also environment mapped, it can effect itself in the appropriate changes in reflection of the environment map.

There is nothing that requires that a bump mapped object also use an environment map. However, there are some ways of implementing bump mapped lighting that uses environment maps to approximate the light characteristics. The kind and size of environment map you're using there will determine the quality of the approximation.

Important: if you're reading tutorials on "du/dv" bump maps, or "EMBM" bump mapping, then those are old hacks from previous graphics generations. They basically ended up with a dead end. Instead, when you think "bump mapping" you should think of them in terms of true normal maps, which can be interpreted in either tangent space, object space, or derived from a displacement-style heightfield "bump" map.
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
There is nothing that requires that a bump mapped object also use an environment map.

Quote:
D3DTOP_BUMPENVMAP
Perform per-pixel bump mapping, using the environment map in the next texture stage, without luminance. This operation is supported only for color operations (D3DTSS_COLOROP).

D3DTOP_BUMPENVMAPLUMINANCE
Perform per-pixel bump mapping, using the environment map in the next texture stage, with luminance. This operation is supported only for color operations (D3DTSS_COLOROP).

It looks to me like it requires it. These are the only two bump texture operations that I can find.

Quote:Important: if you're reading tutorials on "du/dv" bump maps, or "EMBM" bump mapping, then those are old hacks from previous graphics generations. They basically ended up with a dead end. Instead, when you think "bump mapping" you should think of them in terms of true normal maps, which can be interpreted in either tangent space, object space, or derived from a displacement-style heightfield "bump" map.

Like I said before, my video card is not exactly state of the art. It's difficult to program something that cannot be tested. I'm wanting legacy bump mapping for now.

Quote:Original post by JohnBolton
I'm not sure why they say, "Bump mapping is a special form of specular or diffuse environment mapping". That seems inaccurate to me since a bump map describes the surface being rendered and has nothing to do with the surrounding environment.

It appears to be an invironment mapping only situation in DirectX. I always thought that invironment maps made things look shiny. What if you just want a rough look and don't want it shiny? Shininess just won't cut it for my game world. It will be a very rustic setting. Old wood, concrete, rusted metal.

I appreciate the help so far, but I could really use some more.
Quote:Original post by Kest
It appears to be an invironment mapping only situation in DirectX. I always thought that invironment maps made things look shiny. What if you just want a rough look and don't want it shiny? Shininess just won't cut it for my game world. It will be a very rustic setting. Old wood, concrete, rusted metal.

Environment maps are generally used for reflections in shiny surfaces. To make a rough or bumpy surface you use a bump map.

John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
i think EMBM bumpmapping just pertubates the Environment map and doesn't add shadows to the surface like usual diffuse bumpmapping does. So i think you can't use this kins of bumpmapping for reflective surfaces. But i'm not sure about this so anybody correct me if i'm wrong.

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Kest,

There is nothing that requires you to use a bump map and an environment map together - it just happens that those two operations you found do so, and they are quite old now, from a time of hacks, where people did typically just want perturbed reflections. Read again what hplus0603 was saying about them being old hacks, and how things have evolved into using normal maps instead - then using bump mapping without an environment mapping is quite simple, you just need a normal map and to use the D3DTOP_DOTPRODUCT3 operation to do a per-pixel dot product between the normal in the texture and a light vector (which you can pass in through a colour register). This performs the N.L calculation per-texel, giving you a nice bump mapped effect.

Here is something I did about 2/3 years ago which uses bump mapping extensively - the floor, wall and object are made up of just a couple of polygons, and all use normal maps to achieve the detail. As you can see, there is no environment map on any of them.

-Mezz
Quote:Original post by Mezz
.. you just need a normal map and to use the D3DTOP_DOTPRODUCT3 operation to do a per-pixel dot product between the normal in the texture and a light vector (which you can pass in through a colour register).

You didn't see my other post? :)

I made the mistake of thinking the DirectX docs would have mentioned it. Look up bump mapping. All you'll get is information about environment map bump mapping. In fact, the Dot product 3 texture operation description doesn't even mention bump maps or normal maps.

Quote:Here is something I did about 2/3 years ago which uses bump mapping extensively - the floor, wall and object are made up of just a couple of polygons, and all use normal maps to achieve the detail. As you can see, there is no environment map on any of them.

Very nice :)
Is that a morgue? [wink]
I did see your other post, and you continued to talk about bump environment mapping. I know the DX docs don't mention normal mapping particularly well (I think they did at some point in the past, when per-pixel lighting was a new-fangled thing). That is why I explained the D3DTOP_DOTPRODUCT3 operation and it's usage. I'm not sure what it is you want.

-Mezz

This topic is closed to new replies.

Advertisement