Sundog Blog

Posted by Frank Kane on 26th May 2015

Propeller backwash / turbulent wake enhancements

Per-Pixel prop wash in Triton 3.05Version 3.21 of the Triton Ocean SDK includes some new enhancements to propeller backwash (AKA “prop wash” or “turbulent wake”.) These improvements make it easier to estimate the velocity of a ship based on the length of its wake, and to estimate the sea conditions based on these wakes.

Continue Reading

Posted by Frank Kane on 21st May 2015

Fog and Haze with SilverLining

30km visibility with haze in SilverLiningThe most common question we receive about the SilverLining Sky, 3D Cloud, and Weather SDK is how to properly handle reduced visibility conditions. SilverLining offers a lot of flexibility in how fog and haze are handled, but it can be complex and confusing. Our documentation covers the topic, but I’ll try and explain from a higher level in this post.

Telling SilverLining About Visibility

First, understand that normally you tell SilverLining how to fog the sky and clouds. SilverLining is not responsible for fogging your terrain, objects, or whatever else is in your scene. It’s up to you to decide what sort of visibility you want to simulate, tell SilverLining about it, and fog the rest of your scene consistently.

SilverLining allows you to fog the sky and clouds separately. Let’s cover the different API calls that exist for handling visibility:

AtmosphericConditions::SetVisibility() – This causes clouds to fog out and fade out at the given visibility distance. It does not affect the sky itself. If you have an exponential fog density value, you can convert that to a visibility distance using the relationship visibility = 3.912 / density. Note that fog is usually thicker at the ground than up where the clouds are, so it may be appropriate to set a higher visibility value with SilverLining than what you are using for the rest of your scene.

Atmosphere::SetHaze – This exists to let you blend the sky to a solid color at the horizon. Often, this is needed for seamless blending of the sky with fog on your distant terrain. It allows you to set a fog color, density, and height – the height parameter controls how far up the sky box the fog effect reaches. It doesn’t matter what the altitude of the camera is; this is always relative to the horizon. You can use this to apply fog to the sky itself that looks volumetric in nature. You’ll still need to call AtmosphericConditions::SetVisibility() as well, in order to fog out the clouds consistently.

AtmosphericConditions::SetFog – This method applies exponential fog only to the clouds, not the sky, with a specific fog color. It may be appropriate for unusual situations like thick smoke, where you want to apply dense fog to the clouds with a particular color. You’ll still need to use SetHaze() to color the skybox itself.

Under normal circumstances, using SetVisibility() to affect the cloud visibility and SetHaze() to affect the sky colors generally produces the best results.

Fog Inside Clouds

There are some cases where SilverLining will recommend a given fog density and color to be applied to the rest of your scene. One such case is when the camera is inside of a stratus cloud.

If your camera could be inside the clouds, then each frame you’ll want to call Atmosphere::GetFogEnabled(). If it comes back as true, then you must query Atmosphere::GetFogSettings() to retrieve the fog color and density that should be applied to the rest of your scene. This will ensure consistent fogging with the cloud itself, and give you smooth effects as the camera enters and exits the cloud.

Fog Inside Precipitation

If the camera is inside rain, sleet, or snow, Atmosphere::GetFogEnabled() will also return true, and Atmosphere::GetFogSettings() will give you realistic visibility for the precipitation rate you are simulating.

Many customers prefer to manage visibility inside precipitation on their own, and find it confusing when the clouds are no longer directly visible when it’s raining. To disable this effect, open up the file Resources/SilverLining.config in a text editor, and look for the setting enable-precipitation-visibility-effects. Set this to “no”, and SilverLining will no longer indicate fog when inside precipitation.

Choosing a Fog Color

SilverLining can help to choose a realistic color to use when fogging the rest of your scene. Atmosphere::GetHorizonColor() will return the simulated color of the sky near the horizon. This is usually an appropriate color to use when fogging your terrain and other objects, and it’s also appropriate for using as a color if you’re calling Atmosphere::SetHaze().

Atmospheric scattering is a big, complex topic, and SilverLining’s model is actually rather simple. I hope this article de-mystifies handling fog and visibility in SilverLining somewhat.

Posted by Frank Kane on 12th May 2015

Simulated Water Refraction using Transparency

Users of the Triton Ocean SDK sometimes want to have direct control over the transparency of Triton’s water.

Fake Refraction using Transparency with Triton Doing this properly would involve maintaining a refraction texture map for underwater objects and terrain, similar to the reflection map we support for above-water reflections. But, it is possible to approximate the effect by just adjusting the transparency of the water, with a result like this image. It doesn’t properly model the distortion of underwater features you’d see in real life, but it does model how areas of the water will either refract or reflect light depending on the angles involved.

OpenGL users may do this by using Triton’s extensible shader framework. We’ll be working with the user-shaders.glsl file found in the Resources subdirectory of Triton; so open that with a text editor.

Continue Reading

Posted by Frank Kane on 9th April 2015

Announcing SilverLining 4.

SilverLining Software Development Kit for Windows

SilverLining 4's new stratus clouds featured in X-Plane's SkyMaxx Pro 3 add-on.We are stoked to announce the release of SilverLining 4.0!

SilverLining 3 brought you much-improved cumulus clouds, and in SilverLining 4 we’ve turned our attention to vastly improving our stratus cloud layers. No longer are stratus clouds just flat planes with fog sandwiched in between them – they are now fully 3D, featuring a simulation of atmospheric scattering never before seen in real-time. Check out these features of our new stratiform clouds:

  • Simulation of first-order, second-order, and multiple scattering
  • Real simulation of Mie scattering down to 0.1 degree resolution
  • Fogbows, glories, and anti-solar points that just fall out of the math naturally
  • Scattered or solid stratus cloud layers with adjustable scud range
  • Ambient occlusion on cloud tops
  • Silver linings on backlit clouds
  • Fast performance
  • Curved-Earth and geocentric/ECEF coordinate system support
  • Infinite and localized areas of clouds
  • Variable cloud coverage

Fogbow on stratus cloud in SilverLining 4One of my favorite things is how optical effects like fogbows just happen naturally as a result of the math, as seen in this screenshot. Every part of these clouds are driven by a real physical simulation, from the convective noise that forms the basis of the cloud shapes, to every nuance of their lighting. A thin, 400 meter thick stratus cloud will look very different from a 1000 meter stratus cloud for example – just as it would in real life. (The thinner one will look more visually interesting, by the way – 400 meters is actually a good choice for best results.)

Broken stratiform cloud in SilverLining 4.0You can also create stratiform clouds that aren’t solid, as seen here. This can create a lot more depth and visual interest to the cloud, although we recommend using high coverage values like 80-90% with stratus clouds. While you can go lower, you’ll get a better representation of lower cloud coverage with SilverLining’s existing cumulus congestus clouds – especially the high-resolution version of them.

Even though this is a major version bump, SilverLining 4’s API is unchanged. So, updating is a cinch. Your stratus clouds will just start looking a lot better. They’re still fast too – we get hundreds of frames per second, even when drawing a 200km-wide stratus cloud layer.

We’re very excited by the visual quality and performance of these new clouds in SilverLining 4.0. As always, we’ll continue to iterate on them given your feedback as well. SilverLining 4 is available now from our SDK evaluation page, and licensed users have access to its source code as well.

SilverLining Software Development Kit for Windows

Posted by Frank Kane on 31st March 2015

Triton 3D Water Updated for Unity 5

Triton Oceans for Unity 5A new update of our Triton 3D Water for Unity product is now available, including updates to support the new Unity 5 release and the latest Oculus Rift SDK. Get the latest no-risk trial version to evaluate, or you can get the update through the Unity Asset Store.

If you’re developing with the Oculus Rift, this update is a must – not only does it work with the latest 0.4.4 version of the Oculus SDK, there are some important bug fixes with the Oculus Rift integration you’ll want for sure.

Unity 5 now offers native plug-in support as part of its free version, so that means Triton no longer requires the Pro version of Unity! Any Unity user targeting Windows or MacOS can now use Triton to add the most realistic 3D oceans available to their project. Our update also continues to work with Unity 4 Pro, so if you’re not ready to update to Unity 5 yet, that’s OK.

If you’re evaluating Triton for the first time, be sure to read the documentation as it is a complex asset, and sometimes it needs to be adjusted to account for post-processing effects and transparency in your scene.

Not using Unity? Have a look at our C++ SDK instead, which integrates with just about everything else.

Posted by Frank Kane on 26th March 2015

BlueSkies: Pro-Level Skies and Clouds for Unity

BlueSkies for UnityOur friends at AgileSrc LLC have released BlueSkies – a new version of our SilverLining Sky, 3D Cloud, and Weather SDK built for the Unity engine. This brings the same dynamic, procedural sky and 3D cloud effects used by our pro C++ developers to Unity for the first time.

While we’ve offered a stripped-down, inexpensive version of SilverLining for Unity in the asset store for some time now, BlueSkies is a native wrapper around the complete C++ version of the SilverLining SDK. That means you get access to all of SilverLining’s professional-grade features used by simulation and game developers around the world, including precipitation effects, a wider variety of cloud types, a more sophisticated procedural sky, multiple cloud layers, and highly optimized native code for the best performance.

BlueSkies is sold and supported exclusively by AgileSrc LLC; contact or visit the BlueSkies website for more information.

Posted by Frank Kane on 12th March 2015

Tuning Precipitation Effects in SilverLining

Beaufort scale 9 in TritonThe #1 most-asked tech support question we receive is:

“When I enable rain or snow in SilverLining, my clouds disappear!”

This falls into the categorgy of “it’s not a bug, it’s a feature.” SilverLining simulates reduced visibility in the presence of precipitation, and since the clouds are usually very far from the camera, they are often entirely obscured when you’re in the middle of heavy precipitation. We handle visibility effects on clouds by fading them out with distance, in order to ensure they blend smoothly against what may be a non-homogeneous sky behind them.

We determine the proper visibility as a function of snowfall precipitation rate using equations in the following paper:

Rasmussen, Vivekanandan, Cole, Meyers, Masters, “The Estimation of Snowfall Rate Using Visibility”, 1999, Journal of Applied Meteorology, Vol. 38, pp 1542-1563

For rain, our reference is:

Atlas, David, 1953, “Optical Extinction by Rainfall”, Journal of Meterology Vol. 10 pp 486-488.

However, many customers find our reduction in visibility to be too aggressive. There are ways to adjust it to your liking.

First, look for these settings inside the Resources/SilverLining.config file included with the SilverLining SDK:

rain-visibility-multiplier = 1.0
snow-visibility-multiplier = 3.0
sleet-visibility-multiplier = 1.0

Increasing these settings will increase the visibility for a given precipitation rate. You may also disable the effect entirely by setting:

enable-precipitation-visibility-effects = no
apply-fog-from-cloud-precipitation = no

If you do this, we do recommend that you manage your own visibility reduction in the presence of precipitation instead. Heavy rain or snow against a clear, sunny sky not only looks unnatural, it makes the precipitation particles hard to see against the bright background. Precipitation will look best with overcast conditions, when you have a stratus cloud layer in the scene with 100% coverage.

While you’re looking at SilverLining.config’s precipitation section, you’ll see there are many other settings that allow you to adjust the brightness, width, and number of particles. If you want rain particles to be more easily visible, or for precipitation to appear heavier overall, these settings will allow you to do that.

Another common question we get related to precipitation is:

Rain or snow looks fine on the front channel of my simulator, but doesn’t look right on the side channels.

SilverLining by default will try to reverse-engineer your projection matrix, in order to pull in the near clip plane to ensure precipitation particles near the camera are visible, and also to enforce a minimum particle size that will project to some minimum size in pixels. However, some exotic projection matrices on multi-channel displays can mess up our math. In this case, be sure to set your near clip plane to something close to the camera, say no more than 1 meter, and disable these effects by setting:

rain-minimum-pixels = 0
sleet-minimum-pixels = 0
snow-minimum-pixels = 0

rain-use-depth-buffer = yes
snow-use-depth-buffer = yes
sleet-use-depth-buffer = yes

That should clear it up.

SilverLining takes great care to provide physically-realistic precipitation effects, but if you need to tune them, we provide lots of ways to do so. If you need further guidance, don’t hesitate to contact

Posted by Frank Kane on 11th March 2015

Triton Ocean SDK Performance Tips

Rough Seas with Triton at duskLooking to squeeze a few more frames per second out of the Triton Ocean SDK? Here are a few tips on maximizing performance when using Triton.
Continue Reading

Posted by Frank Kane on 2nd March 2015

About SilverLining Skies & 3D Clouds for Unity

SilverLining and Triton for UnityIt’s not something we promote much, but we do offer a special version of our SilverLining product for the Unity engine in the Unity Asset Store. Often, Unity customers will come here to learn more about it, but confuse the Unity version with our flagship C++ SDK instead.

They’re not the same thing, and the different price points ($100 vs $2500) should tip you off on that. SilverLining for Unity is something we built for the larger, low-budget indie game development crowd, and to keep its price low, we had to restrict its feature set. SilverLining for Unity is written from the ground up in C# within Unity’s framework, so although it shares some algorithms with the C++ SDK version, that’s about it.

SilverLining for Unity includes dynamic, procedural skies (including stars) for any time of day or location using the Preetham sky model, and 3D billboard-based cumulus congestus clouds for any given coverage. Stratus and cirrus clouds are also offered as part of the package. Because it was written from scratch for Unity, it is compatible with any platform Unity supports, including mobile platforms such as Android and iOS. It also provides direct and ambient light sources for your scene, so your lighting will match the time of day you are trying to simulate, automatically. This is a big part of the much-touted “global illumination” promised by Unity 5, but SilverLining’s been offering this piece of it for years.

What SilverLining for Unity doesn’t include are things like precipitation effects, GPU ray-casted stratocumulus clouds, support for geocentric, round-Earth terrains, cumulonimbus clouds and thunderstorms, crepuscular rays, Hosek-Wilkie skies, high-resolution cloud textures, sandstorms, or support for any platform other than Unity. And at $100, the technical support we can provide for Unity is of course limited.

However, many of those features, such as precipitation or crepuscular rays, are available from other inexpensive assets for Unity that complement SilverLining well. A larger offering for Unity at a higher price may come in the future, but for now please keep in mind that SilverLining for Unity and SilverLining for C++ are two different products with very different prices and feature sets.

Hopefully this will help clear up some confusion from our Unity customers.

Posted by Frank Kane on 11th February 2015

SilverLining Performance Tips

SilverLining clouds and crepuscular rays in the X-Plane SkyMaxx Pro add-on.Looking to maximize your FPS when using the SilverLining Sky, 3D Cloud, and Weather SDK? We’ve made SilverLining highly configurable, so you can choose your own tradeoffs between visual quality and performance. Here are some tips for turbocharging SilverLining in situations where performance is critical.
Continue Reading