Jump to content
• Advertisement

# Normal mapping - diffuse texture dependance

This topic is 4594 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 everyone, Having been working with normal mapping technique for some time now, I came to a conclusion that it depends badly on general brightness of the diffuse texture it's combined with. If the texture isn't bright enough, bumps may not be visible. Is there any way around it? Should I use some other bump mapping technique for using with dark diffuse textures? Maybe I'm just doing something wrong, but it seems obvious to me that imaginary bumps' "shadows" that normal mapping generates will always fade on a dark surface. Thank you

#### Share this post

##### Share on other sites
Advertisement
I'm going to move this over to GP&T as this seems to be a more general graphics issue. Chances are that if anyone has an answer, it'll be one of the GP&T regulars [grin]

The quality of your lighting does depend quite substantially on the source artwork. As I'm sure you've probably seen in commercial games, good art can make average technology look excellent (I'm thinking of HL2 [wink]).

I can't remember where, but I do remember reading that diffuse maps should be created with low-frequency/low contrast colours. Allow the lighting/normalmap to provide the luminance rather than have it inherantly stored in the diffuse component.

For example, if you had a dark-grey/black area in a diffuse map, it'll take an extremely bright light to increase its final colour - multiplying the incoming lighting by 0.0 - 0.1 will almost always result in a dark output..

Jack

#### Share this post

##### Share on other sites
How are you doing your normal mapping? Perhaps there is a mistake somewhere.

I can see how you would get the results you describe if you accidentally are doing something like this:

pixel color = dot(vVertexNormal,vLightDir) * vTextureColor * vNormalMap;

Remember that normal mapping is a perturbation of the vertex normal. So in reality, your equation should look something like this:

vNormal = normalize(vVertexNormal + vNormalMap);
pixel color = dot(vNormal, vLightDir) * vTextureColor;

neneboricua

#### Share this post

##### Share on other sites
I think the bumps will "fade" on a dark surface, no matter what bump / normal / displacement mapping technique you use, simply because on a dark surface a lit pixel won´t be much of a difference to an unlit one, except you´re doing some additional specular mapping, simple gloss or reflection on the surface which would show the bumps more clearly.
Using neneboricua´s equation:
pixel color = dot(vNormal, vLightDir) * vTextureColor

with a vTextureColor value that has low brightness clearly scales down the range of the resulting color, so less contrast, therefore the bumps will somewhat fade out, no matter how vNormal is calculated (that is, as long as vNormal and vLightDir are normalized vectors).

#### Share this post

##### Share on other sites
Normal mapping and similar techniques "visualize" the bumps using only (non ambient) lighting. Naturally, the less the lighting the less visible the effect is.
Extreme case: If no lighting is present, no bumps are visible at all.

Parallax/Displace mapping visualize the bumps by pertubating the texture coordinates, to give a 3D appearance. I assume the visibility of the effect depends on the color range: More different colors in adjucent areas, the bumps are more visible. If the colors are similar, then the pertubation won't change the resulting image much.
Extreme case: If the object has only 1 solid color all over, no bumps are visible.

So, a dark object has both low light and small color range/frequence. It's natural that the bumps will be less visible even using both techniques(Normalmapping&displacement). Note that what happens in the real world is similar. When it is easier to notice the bumps on a brick wall? In a well-lit room or in a bitch-black room? On a wall painted in stripes or in a wall being painted white all over?

#### Share this post

##### Share on other sites
If you're really concerned about it, you might want to integrate specular lighting with your stuff, since that is able to really show off the normal maps much more than just the N dot L term could ever do, because it is typically much brighter than the diffuse lighting and uses a much sharper falloff, typically.

#### Share this post

##### Share on other sites
Yes, I am really concerned about it. Specular lighting is typically just a light map added on top of everything, isn't it? I don't see how it may show off the bumps though. I'm probably missing something.

#### Share this post

##### Share on other sites
Quote:
 Original post by tokaplanYes, I am really concerned about it. Specular lighting is typically just a light map added on top of everything, isn't it? I don't see how it may show off the bumps though. I'm probably missing something.

No, specular lighting is kind of "refelected" lighting, it's what you see when a surface "shines", and is dependant of the viewer also. But it's not for all surfaces, because they're not all shiny, regardless of what some game developers seem to think these days.

Why are you so concerned about it? I've already explained that similar things happen in the real world. If you want details on surfaces to be more apparent, increase the lighting. If you don't increase it, details on surfaces will be less visible. It's not rocket science.

#### Share this post

##### Share on other sites
Specular highlights are light *added* to the surface color (in the rendering)
The equation usually looks something like:
(ambient_light + diffuse_light) * texture_color + specular_light

Specular lighting is also calculated as a reflection of the light sources in the scene. Look up Phong stuff :) Wikipedia is a great place to start.

-Michael g.

#### Share this post

##### Share on other sites
Quote:
 (ambient_light + diffuse_light) * texture_color + specular_light

Shouldn't this be
max(diffuse_light*texture_color, ambient_light*texture_color) + specular_light;

?

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
frob
14
3. 3
4. 4
5. 5
Rutin
12
• Advertisement

• 12
• 10
• 57
• 14
• 15
• ### Forum Statistics

• Total Topics
632113
• Total Posts
3004181

×

## Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!