WebGL Demos
PHP Data Pivot
PHP Data Subtotals
HTML5 Graph
Java NW3D2
JS Code Formatter
HTML5 Clock
Silverlight Gauge
Java NW3D
Java Fireworks
Java Early 3D
Java Snow
Java Dogfight
Java Water Simulation
Java Bump Mapping
Java Elite Ships

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