View Full Version : bumpmapping in the darkness

06-09-2004, 05:33 PM
Q/ a while ago on this forum was mentioned a method when the bumped surface is not exposed to the light ie dot(light,normalmap) is less than zero, so instead of looking dark and flat this surface still retains some bumpiness, if i recall there was a picture of the stanford rabbit with a bluish hue (on the dark side) does anyone have any links/info cheers
(i hope this makes sense)

06-10-2004, 01:28 AM
You probably mean "ambient cubemaps" or some variant (interpolating two colors, or two textures or whatever)
For cubemaps it works very simple, just do lookup in the cubemap based on the per pixel normal.
If you use a blurred or low-res cubemap this should give you some bumpy ambient color.


06-11-2004, 02:30 AM
You can also do a dot between the surface normal and the bumpmap in your ambient pass and multiply that with the ambient color. This is just a fake but gives you some bumpy detail in unlit regions.

(Edit: added the other side of the dot)

Tom Nuydens
06-11-2004, 03:17 AM
Originally posted by Lars:
You can also do a dot with the surface normal in your ambient pass and multiply that with the ambient color.Dot the surface normal with what?

-- Tom

06-11-2004, 10:08 AM

Christian Schüler
06-11-2004, 01:25 PM
Since most light comes from above, you might lerp between two colors based on the y component of the normal alone.

ambient_color = 0.5 * ( above_color + below_color ) + normal.y * 0.5 * ( above_color - below_color );

06-11-2004, 05:20 PM
Originally posted by Tom Nuydens:
Dot the surface normal with what?I assume he means dot(bumpmap, faceNormal);

06-12-2004, 07:18 AM
Another way to go is to assign the ambient light a "pseudo direction". A suitable choice would be the direction of the sun since it is the main contributer of ambient light anyway. On backfacing fragments you then subtract the bumpmap dot the direction (or add, since this will of course be negative) times some constant (suitable values are about 0.4). This retains the creasiness of the backfacing surface pretty well. The technique can also be extended to work with shadows.

06-13-2004, 04:30 AM
Yes, only I suggest you use the negative sun direction, that that's where the most of the indirect light is coming from (unless it's cloudy), and it'll give you the nice backlight effect commonly used by traditional artists.


06-13-2004, 05:37 AM
I'm wondering why anyone hasn't mentioned parallax mapping yet.After all,it was invented by some guy who frequents these forums.

06-13-2004, 07:31 AM
You could just as easily reverse the light vector, reverse the half angle vector, do the dot product and scale it to a "low value".

You could divide by 10, for example.

06-13-2004, 08:53 AM
parallax mapping works pretty good on textured objects, because polygons not facing the light still get rasterized with a distortion algorithm.
Problems :
- works best on 2D-textured objects, not to mention it works almost exclusively with 2D textures (not a big deal considering today's modeling techniques),
- needs texture-dependant read hardware (GF3/4Ti or higher, Radeon8500 or higher) for simple parallax mapping (only decal and lighting) and needs better hardware (GFFX, Radeon9500 and higher) for advanced effects (cubemap reflection, etc).

06-14-2004, 01:57 PM
Another good technique I've heard of for ambient approximation using a main light direction vector is hemispheric lighting gives you both sun and approximation to reflected light.

06-14-2004, 02:42 PM
If you're going to implement parallax mapping, then you'll need a height map. And if you have a height map available, you can add a nice little lighting hack by modulating your ambient light with the height. This looks the best on materials with "cracks" such as brick textures, because you'd expect a little more darkness at the bottom of cracks.

06-14-2004, 02:55 PM
Originally posted by dorbie:
:-)Bumpmapping in the dark makes you happy doesn't it? :D