Hi all,
I've implemented a (very alpha) sun shader layer using GLSL shaders. It shows a reflection of the sun off the ocean using basic specular lighting calculations. It also shows the NASA night lights layer on the side of the earth with no sun.
It uses a slightly modified RectangularTesselator class that calculates normals according to the globe surface (assumes it's a ellipsoid, doesn't calculate terrain normals).
To use this layer you must have a video card that supports shaders. You must also set the tesselator class name using the code as follows (before the WorldWindow is set up):
I've created a special tile set to support this layer. The layer won't work without it. It is quite simple: the oceans are blue, the landmass is green, and the nightlights are red (nightlights on landmass = green+red = yellow). The shader then takes these colours and makes it look lovely.
This tile set was created from the freely available NASA blue marble and nightlight images. Obviously it is too big to upload as an attachment, but I've uploaded the first level (level 0) so people can test the layer. Simply extract it to your cache directory, or add the extracted directory to the data file cache using WorldWind.getDataFileCache().addCacheLoc ation().
I hope people extend this!
Kind regards,
-Michael
I've implemented a (very alpha) sun shader layer using GLSL shaders. It shows a reflection of the sun off the ocean using basic specular lighting calculations. It also shows the NASA night lights layer on the side of the earth with no sun.
It uses a slightly modified RectangularTesselator class that calculates normals according to the globe surface (assumes it's a ellipsoid, doesn't calculate terrain normals).
To use this layer you must have a video card that supports shaders. You must also set the tesselator class name using the code as follows (before the WorldWindow is set up):
Code:
Configuration.setValue(AVKey.TESSELLATOR_CLASS_NAME, NormalTessellator.class.getName());
This tile set was created from the freely available NASA blue marble and nightlight images. Obviously it is too big to upload as an attachment, but I've uploaded the first level (level 0) so people can test the layer. Simply extract it to your cache directory, or add the extracted directory to the data file cache using WorldWind.getDataFileCache().addCacheLoc ation().
I hope people extend this!
Kind regards,
-Michael
Comment