For information on using the Sky Sequencer to create cloud sequencers for use with your SDK intergration click here

Description on how to gain access to the SDK

The SDK comes as a set of libraries, under a main “Simul” directory. These can be linked statically or dynamically, depending on the platform. Binaries reside in the directory “Simul/lib” in the case of static libraries, and in “Simul/exe” for dll’s. Source is found in the subdirectories for the constituent libraries.

In exe and lib, the following structure is observed:

  • Win32
    • VC11
      • Debug

      • Release

      • Static Debug

      • Static Release

    • v140

  • x64
  • {console platforms}

The compiled Windows libraries are in two runtime versions, MD and MT. The runtime is the set of libraries provided by Microsoft that provides basic system functions. You should generally use the same runtime all the way through a project, although different runtimes can be used for DLL’s, because they are self-contained

For Windows, the Debug and Release configurations are supplied as DLL’s linked against the dynamic, MD runtime. The Static Debug and Static Release configuratons are supplied as static libraries linked against the static, MT runtime.

TrueSkyPluginRender Library

Integrating the SDK

To build the samples, use the solution file appropriate to your Visual Studio version, e.g.:

  • SimulSamples_x64_VC11.sln


The two main elements to implementing trueSKY in a project are: an Environment object, which will encapsulate sky and cloud data; a WeatherRenderer, and a RenderPlatform.

You should create an instance of link simul::clouds::Environment environmentendlink, which is persistent.

#include "Simul/LicenseKey.h"
#include "Simul/Base/EnvironmentVariables.h"
simul::clouds::Environment *environment=NULL;

Apply your trueSKY licence key (see Licensing for more details), and initialize the Environment instance:

environment=new simul::clouds::Environment();

The Environment is API-neutral, it calculates and updates environment data. We will create a persistent link simul::crossplatform::renderplatform RenderPlatform endlink, whose class depends on the graphics API we use:

simul::dx11::RenderPlatform renderPlatformDx11;

The RenderPlatform classes implement platform-specific rendering functions called from a cross-platform interface. And we will create a weather renderer, which is also API-neutral:

simul::clouds::BaseWeatherRenderer *weatherRenderer=new simul::clouds::BaseWeatherRenderer(environment);

In the case of DirectX 11, we initialize the RenderPlatform with a pointer to our ID3D11Device:

void OnD3D11CreateDevice(struct ID3D11Device* pd3dDevice)

Having done this, we can now pass the render platform pointer to the device-specific initialization of our renderers:


In-game, we update the environment, usually once per frame:


The time step is given in days - a floating point value, usually some small fraction less than one. This is the simulation time step, rather than real-time. Then to render:

void Render(ID3D11DeviceContext* pContext)
    simul::crossplatform::DeviceContext     deviceContext;
    deviceContext.platform_context                          =pContext;
    deviceContext.renderPlatform                            =&renderPlatformDx11;
    deviceContext.viewStruct.view_id                        =view_id;
    deviceContext.viewStruct.depthTextureStyle      =crossplatform::PROJECTION;
    deviceContext.viewStruct.view                           =viewMatrix;
    deviceContext.viewStruct.proj                           =projectionMatrix;

We’ve created a link simul::crossplatform::devicecontext endlink object that we will pass to the render functions. This object encapsulates the platform-specific context - in this case it’s an ID3D11DeviceContext pointer - and view-specific information: the view and projection matrices for example.

There are different types of projection matrix, and some are better than others. The classic projection transforms a viewspace position into a clip position and depth value, where depth=0 is the near plane and depth=1 is the far. But this forward projection has a very inefficient distribution of depth values with respect to distance, and causes a loss of precision. Superior to this is the reverse projection, where depth=0 represents the far plane, and depth=1 the near. It’s strongly recommended that you use reverse projection to get the best visual results from trueSKY. The projection matrix that you send to trueSKY should be the same one that was used to create your depth buffer.

Each individual view that you want to draw simultaneously on screen should have its own unique view_id. You don’t have to explicitly create views, but you should call:


to free up GPU memory if a view is removed.

We specify the depth texture style so that trueSKY knows how to interpret the depth information you pass to it. The matrices link simul::math::matrix4x4 Matrix4x4 endlink are row-major view and projection matrices stored as a simple block of 16 floats - you can cast from most standard matrix classes directly.

Once per frame, before rendering , we must call PreRenderUpdate, located in link cloud renderer simul::clouds::cloudrenderer cloud rendererendlink, passing a deviceContext that refers to mainview.


The parameter real_time_s is real time in seconds - as distinct from simulation time, which might be greatly accelerated, or change instantly, real time is used mainly for effects like rain that we might not want to appear accelerated.

For each view, we render the sky, passing an appropriate device context.

,(float) exposure
,(float) gamma

The exposure is a brightness multiplier - 1.0 is a good value, but the chosen number depends on how bright you want the sky to be relative to your scene. We can also perform gamma correction.

We use is_cubemap to specify whether we’re doing a cubemap render. If so, shortcuts will be used to draw with less detail. We pass a depth texture, because the atmospherics and clouds need to use this. The depthViewport specifies what area of the texture is being used for the current view (some engines store a larger texture and use a portion of it): pass NULL here to use the entire texture. See also Mixed Resolution Rendering.

Platform considerations

DirectX 11

To use DirectX 11, build the DirectX11 platform library in Simul/Platform/DirectX11.

The DirectX platform library used the DirectX SDK by default, but can be recompiled from the provided source to run on the Windows 8 SDK.

The location of the most recent DirectX SDK on your hard drive is usually given by the DXSDK_DIR environment variable - it is usually of the form ‘C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)’ etc.

To build with the Windows 8 SDK, ensure that both the DirectX11 library and the executable are using the standard toolset (e.g. v110, not v110_xp), remove the SimulDXSDK.props property sheet from the projects, then add the SimulWin8SDK.props property sheet to both projects. Rebuild Simul/Platform/DirectX11 and the executable.

To add True Sky to a DirectX 11 project, you need to link with the Simul core libraries, and also with the DirectX11 project. You can use the Simul property sheets - e.g. Simul/Platform/DirectX/SimulUseDXSDK.props, alternatively:

  • In the project properties, select Configuration:All, then under “Configuration Properties, C++, General” add the following to “Additional Include Directories”:


The SIMUL environment variable is set by the trueSKY installer, while the DXSDK_DIR variable is set when you install DirectX.

  • Under “Configuration Properties, Linker, General” set “Additional Library Directories” to:


where VC11 should be replaced by VC12 etc for different Visual Studio versions, and x86 by x64 for 64-bit builds.

  • In your initialization code, setup file loading and paths if needed, before creating the weather renderer:


For example, the DirectX11 sample uses the default file loader, and the paths to shaders in “Simul/Platform/DirectX11/HLSL” and textures in “Simul/Media/Textures”.


In order to build the OpenGL sample you will need GLUT, and GLEW (both included in Simul/External). GLSL is used for shaders. You should build the OpenGL platform library in Simul/Platform/OpenGL.

To add True Sky to an OpenGL project:

  • In the project properties, select Configuration:All, then under “Configuration Properties, C++, General” add the following “Additional Include Directories”:

  • Under “Configuration Properties, Linker, General” set “Additional Library Directories” to:

  • The libraries themselves are linked automatically when the headers are included.

  • On scene initialization, initialize the shader path and the weather object:


DirectX 12

Documentation coming soon, If required please directly request via a support form


Documentation coming soon, If required please directly request via a support form