Sunlight package for WorldWind Java
Here is the very first iteration of a sun light package for NASA WorldWind Java. It includes a custom tessellator for terrain shading, an atmospheric scattering based sky layer, a sun position calculator and a lens flare effect. Some of the code has been contributed by WWJ Forum member Michael de Hoog aka Omega.
Download the sunlight package (Zip 33K). Unzip in the SDK examples package and run the sunlight.SunShading.java demo application.
The demo application code will show you how to use the different components. Although this initial version works rather well, you may notice a couple issues. Dark or bright bands may show across the terrain in some places. The atmospheric scattering code is not optimal. It fails to produce a blue sky at ground level and the sky underlying geometry is too coarse to produce nice and smooth sunsets. The sun calculator reported position does not seem right either.
Enjoy!
Terrain shading
Download the sunlight package (Zip 33K). Unzip in the SDK examples package and run the sunlight.SunShading.java demo application.
Lens flare and atmospheric scattering
The demo application code will show you how to use the different components. Although this initial version works rather well, you may notice a couple issues. Dark or bright bands may show across the terrain in some places. The atmospheric scattering code is not optimal. It fails to produce a blue sky at ground level and the sky underlying geometry is too coarse to produce nice and smooth sunsets. The sun calculator reported position does not seem right either.
Sun occlusion
Enjoy!
9 comments:
Looks nice. Is this being added to the night builds any time soon?
It may be integrated into the SDK at some point but i can't tell if and when. Right now, we are more worried about sorting out the core components from what can be considered as extensions.
well, integrating the shading in an application was easier than I though, just change the default tessellator.
Shading [of course] slows down thing quite some.
But it would be great if the shader tesselator was as fast as the regular one when the light parameters are set to null; I noticed some slow down in comparison with the normal one.
Any clues?
I haven't noticed much of a slow down, but that does not mean there isn't.
The tessellator is doing extra work to compute the normals needed for shading - whether light is enabled or not. But it does that only once when creating a new terrain geometry tile. After that the normals are cached and passed to the GPU at draw time. However, if light is not enabled, the GPU will not do extra work on lighting.
Normal computation could be postponed until light is on and they are needed though.
how to place Lunar Crater names on moon image using java?
Which classes i need use to find that placenames(craternames) of particular LatLon on moon?
Please help me in this regard
Thanking You
Gopinath Avuku
Please post World Wind Java general questions to the World Wind Forum. You are more likely to get answers and others will benefit from the discussion.
Hi there - a bit late to the party I know...but from what I can figure - this never made it to the general build...any way to get this code working on the latest version of the SDK ?
The SDK has evolved a lot since this code was written and it will probably need some ajustements to fit into the current release. Most of it is based on the 'regular' tesselator with the only addition of normal computation so it may not be that much work to port the old code.
My best suggestion is to ask on the World Wind forum. Maybe someone has done it already.
Thanks Patrick will do that.
Post a Comment