Sign in to follow this  

Normal mapping - diffuse texture dependance

This topic is 4348 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


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


Link to 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


Link to 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


Link to 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


Link to 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


Link to post
Share on other sites
Quote:
Original post by tokaplan
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.


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


Link to 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


Link to post
Share on other sites
No it shouldn't because that max you have there basically means either the diffuse component or the ambient component will be added to the final colour but you're meant to have both of them.

You could also modulate the specular_light term by a specular map (AKA a gloss map) if you want a material which isn't uniformly shiny (e.g. rusty metal).

Share this post


Link to post
Share on other sites
Quote:
No it shouldn't because that max you have there basically means either the diffuse component or the ambient component will be added to the final colour but you're meant to have both of them.

Okay, I'm convinced, but getting slightly confused. In order to prevent your texel from becoming completely white where there are no specular reflections, wouldn't the equation become:

final_color = min(texel * (ambient + diffuse), texel) + specular;
?

Share this post


Link to post
Share on other sites
You don't do that, in that case anything which makes the surface lighter would get cancelled out which would look rather strange. Basically you've got to be careful that you don't have too many lights (or make them too bright) to avoid saturation.

The proper way to solve this problem is to utilize HDR rendering which can give you a full 32-bit float for every colour channel, once the scene is rendered in this format you apply something that converts the HDR data into a dynamic range suitable for display on a monitor (i.e. maps each channel to an integer in the range of 0-255).

Share this post


Link to post
Share on other sites

This topic is 4348 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this