Your Location:Home>Texture Map >

Simul trueSKY

 

Simul trueSKY – Realistic Skies Rendered in Real Time

trueSKY is a software development kit that allows realistic skies, clouds and atmospheric effects to be rendered in real time on a variety of platforms.

TrueSKY is the culmination of many years’ research and development. It is based on physical principles of light scattering and absorption, and is highly optimized for speed. We believe it is the best-performing system for realistic realtime skies and clouds.
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.

 

Unity

To use the trueSKY Unity plugin, install the appropriate trueSkyUnityPlugin.unitypackage to your Unity project.

Unreal Engine 4

The trueSKY Unreal Engine 4 plugin comes as a branch of the UE4 engine on GitHub, and also as a separate installer for the binary distribution of UE4.

trueSKY SDK

The trueSKY SDK can be integrated with a game/simulation in two different ways. Firstly, it is possible to dynamically link with the trueSkyPluginRender library and API just as we do for Unity and Unreal. The second option is to link the trueSKY libraries directly, and access the lower-level classes directly.

All Simul’s default renderers use a right-handed co-ordinate system with x pointing East, y North, and z up. All units of distance are metres or kilometres. If not specified as km, distance is in metres. Angular units are radians, unless specified as degrees. Temperature is in kelvins, unless specified as degrees Celsius.

Weather Rendering is handled by ::clouds::BaseWeatherRenderer BaseWeatherRenderer\endlink.

The Weather Renderer owns and manages renderers for sky, clouds, atmospherics and other effects. So the Weather Renderer is the main interface between your program and trueSKY.

 

The following table describes the elements of a sky as implemented in the renderer:

Features

Cosmic Background

Stars

Planets

Volumetric Clouds

2D Clouds

Mixed resolution rendering

Atmospherics

Godrays

Precipitation

Rain streaks

 

Cosmic Background

The cosmic background texture is drawn first, at an orientation that corresponds to the plane of the Milky Way galaxy - see

::sky::SkyKeyframer::SetBackgroundBrightness BackgroundBrightness\endlink.

It uses a plate-carree projection, aligned with the galactic horizon. Given the vector “view”, which is the direction in galactic co-ordinates, the calculation is:  

float az       =atan2(view.y,-view.x);
vec2 texcoord  =vec2((ang/(pi*2.0)),0.5-asin(view.z)/pi);

 
i.e. the x coordinate is proportional to the azimuth, and the y coordinate is proportional to the elevation.

You may see some stretching at the top and bottom of the image due to degeneracy of the projection, so it is preferable to have the texture fade to black at the top and bottom edges.

Stars

Stars are drawn as point sprites, and spun around the axis of the Earth’s rotation, in the same direction as the sun. Stars are usually drawn to the highest-resolution buffer (i.e. the frame buffer or final buffer). See

::sky::SkyKeyframer::SetStarBrightness StarBrightness ::sky::SkyKeyframer::SetMaxStarMagnitude MaxStarMagnitude\endlink.

The Sun

The sun is drawn after the stars.

Planets

Planets (e.g. the Moon) are drawn by BaseSkyRenderer. A planet texture map needs to be supplied, and the shader takes a sun direction as a parameter - this is used to light the planet (e.g. phases of the moon). Like stars, planets are usually drawn to the highest-resolution buffer, in order to make sure they have sharp outlines.

Sky/Atmospherics

The sky and atmospherics are drawn to a volumetric texture for which the x and y axes are screen coordinates, and the z axis is distance. The final compositing step puts the sky, atmospherics and clouds to the current rendertarget.

Clouds

Clouds are usually drawn to a pair of lower-resolution buffers. The ::clouds::BaseCloudRenderer BaseCloudRenderer the cloud volume textures up to date, and draws the clouds volumetrically.

Performance

Rendering performance is chiefly dependent on the number of pixels drawn, and the number of raycasting steps (or Cloud Slices). Calculation performance - mainly cloud lighting - depends strongly on the grid size - the larger the grid, the more time will be taken to light a cloud keyframe.

It is usual to downsample the cloud part of the sky rendering, controlled by ::clouds::CloudRenderingOptions::MaximumCubemapResolution MaximumCubemapResolution the ::clouds::CloudRenderingOptions CloudRenderingOptions\endlink.

Rain and Snow

The ::clouds::CloudKeyframe::precipitation precipitation used to control the amount of rain or snowfall at a given time, whilst the ::clouds::CloudKeyframer PrecipitationThresholdKm is used to set the thickness of cloud required for rain to fall (setting this to 0 will allow even the smallest of clouds to produce rain). To switch between snow and rain use ::clouds::CloudKeyframe rain_to_snow\endlink (where 0 is rain, 1 is snow).

Each cloud keyframe has a ::clouds::PrecipitationRegion PrecipitationRegion\endlink, which defines the local area of precipitation, if it is not global for the keyframe. The amount of particles used for precipitation can be altered with the ::clouds::BasePrecipitationRenderer MaxParticles.

Classes derived from simul::clouds::BasePrecipitationRenderer are used to draw the rain or snow particles, while the ::clouds::PrecipitationRegion rain streak effect drawn by the cloud renderer. This class has a property “UseSimulationTime” which determines whether rain and snow speed is based on the simulated time-of-day, or real time in seconds.

Shaders

Shaders are provided as source in the shader subdirectories of the platform directories (see ).

 

The Plugin Rendering Interface

One way to connect trueSKY to a game or simulation engine is using the Plugin Rendering Interface. A dynamic link library or dll called PluginRenderInterface.dll (or similar) is loaded, dynamically, from within the game engine. The exported functions are used to perform sky rendering per-frame for each view.

The Sky Sequencer

The Sky Sequencer is a tool for artists, technical artists, level designers, and mission planners. It also helps programmers to understand the workings of True Sky’s sky, clouds and time-of-day systems.

To launch the Sequencer, go to Start Menu/All Programs/Simul/Sky Sequencer/Sky Sequencer.

北京哲想软件有限公司