Normal Mapping in WWJava
Written by Chad on August 1st, 2009Omega on the WorldWind Forum has been at it again, this time with improving normals in WWJava.
Here is his post on the topic:
I’ve been toying with per-pixel lighting (see my Sun shader thread), but found that the normals generated by the tesselator are quite low resolution. So I implemented a normal map layer that calculates the normals from an elevation model.
It pulls the elevation data directly from the ElevationModel, generates a normal map for each elevation tile, and passes the normal map as a texture in a TiledImageLayer to a shader, which calculates per-pixel lighting and shading. The results are quite encouraging (see screenshots).
The exaggeration in the shader can be changed in realtime, and so could the elevation colors (by editing the fragment shader to accept different color gradients as uniforms).
And the results of his changes:
Does this make a big difference? You bet it does! Here is a comparison of “How it is done” and “How it can be done better”:
Same view with per pixel norm map
3
AM
Wow…nice. A big difference.
[Translate]