Version 6.38 of the SilverLining Sky, 3D Clouds, and Weather SDK now includes a beta release of Vulkan support, in addition to OpenGL and Direct3D! Vulkan is the lower-level, higher-performing successor to OpenGL that is gaining traction in the simulation and training industry as the underlying technology for real-time 3D graphics.

Vulkan-based applications tend to be very complex, as this lower-level API moves much of the code that used to be hidden within graphics drivers into your application. Most developers will be using frameworks that simplify Vulkan development, such as VulkanSceneGraph or the cross-platform Diligent Engine. We’ve included samples with the SDK for each; please see our related articles on VulkanSceneGraph integration and Diligent Engine integration for more details.

SilverLining 3D Clouds in the Diligent Engine

Diligent Engine integration

SIlverLining sky and 3D clouds integrated into VulkanSceneGraph

VulkanSceneGraph integration

For those who are developing directly against Vulkan, we’ve also included a Vulkan example in the SDK that is a fully-featured stand-alone Vulkan application. It’s our own testbed, and illustrates usage of all of SilverLining’s features under Vulkan. This includes multi-threaded rendering of multiple viewports, our full selection of cloud layer types, time of day effects, automatic generation of environment maps (shown above) and shadow maps from the sky and clouds, crepuscular rays, precipitation, and more. Refer to the readme file included with the Vulkan sample for more details.

For those already familiar with SilverLining’s API, there are a few differences when using Vulkan to be aware of:

  • When calling SilverLining::Atmosphere::Initialize(), you must pass in a pointer to a SilverLining::Vulkan::VulkanInitInfo structure to the “environment” parameter. This structure is defined in our VulkanInitInfo.h header, which you must include explicitly (this is to avoid dependencies on the Vulkan SDK for customers using OpenGL or DirectX.) This includes various properties of the Vulkan device, swap chain, and render pass you wish to integrate SilverLining with. Every member of this structure is required, except for the VulkanMemoryAllocator member. You may optionally provide your own memory allocator to integrate SilverLining with your own Vulkan memory management scheme here, which the sample illustrates.
  • Prior to drawing the sky and clouds each frame, you must call ThreadCameraStreamData::SetStream() to pass in both the current Vulkan command buffer and the index of the current swap chain image being rendered.
  • Vulkan must be set up with dynamic scissoring supported, and you must set a viewport and scissoring rectangle to Vulkan each frame.
  • With Vulkan, you can build up command lists for different views in parallel. The Vulkan sample illustrates an architecture for managing per-camera data for each view by associating a SilverLining::Atmosphere instance with each; the –threading command line argument allows you to test this functionality. This is especially powerful for simulators that drive multiple views and for virtual reality applications.
  • Under Vulkan, crepuscular rays must be explicitly created and drawn after the clouds using Atmosphere::GenerateCrepuscularRays() and Atmosphere::DrawCrepuscularRays(). Refer to SilverLiningVulkanExamplePerWindowData::DrawSkyAndClouds() in the Vulkan sample for an example of usage.

If you are rebuilding any of our Vulkan samples, or SilverLining’s Vulkan library from source, be sure to install the Vulkan SDK and its dependencies first. Other prerequisites are listed in the readme files for individual samples. The Vulkan SDK is not required at runtime with your distributed applications. Under Linux, you must run make vulkan to build SilverLining with Vulkan support. Under Windows, Visual Studio 2022 or newer is required as Vulkan requires modern C++ features.

Vulkan support in SilverLining is available to current license holders with an active support and maintenance plan, as well as to new licensees. License purchases and support plan renewals may be purchased at our online store, or contact us for a formal quote. Free evaluation SDK’s are also available at https://sundog-soft.com/evaluation-downloads-silverlining/.