|
This is a lighting technique which is quite effective. The sample application is built in flash 9 and is calculated per pixel.
The technique works as follows. 1) For each pixel the gradient of the heightmap in the x and y direction is calculated. 2) this is used as an offset into the phong map (a radial gradient).
Thats really it. This causes positive slopes to be lit brightly, and negative slopes (in shadow) to have very little light. The only other trick is the 'rake' which is an
image of 5 gaussian blurred ovals which are either XOR'ed, added or subtracted from the heightmap. p.s. the previous mouse position is used to rotate the 'rake' so that it appears to drag in nice curves.

http://www.urhost.co.nz/sand/
|