2D Bump Mapping using Java

Bump Mapping is quite a cool looking effect that takes very little coding. There are many examples of bump mapping available on the Internet. The three basic ingredients are:-
For each frame of animation we calculate the difference between each bump map pixel's X/Y normal and the X/Y normal of the light source relative to our current position. This is then used as an offset index into the environment map. Smaller differences indicate a narrow angle between the pixel and the light source, larger differences would indicate a point that is far away from the light source or perhaps angled away from it.


Launch Applet

This second demo applet uses a larger light source with greater Phong element.


Launch Applet