We’ve talked with the developers of TrueSKY about the way their plugin helps to build some amazing weather effects in real-time scenes.
We’ve talked with the developers of TrueSKY about the way their plugin helps to build some amazing weather effects in real-time scenes.
©2016 Michael Gerard. All Rights Reserved
Intro
We’re Simul Software, a UK company specializing in real-time weather rendering. We’ve been around for almost ten years now: our first big innovation was in rendering volumetric clouds in real time – we netted an award from the British Computer Society for our research! We provided weather effects for Sony’s Drive Club, and for the Arma and DayZ franchises among others. Lately, trueSKY has been seen in Bandai Namco’s forthcoming Ace Combat 7, and Flight Sim World, the follow-up to Microsoft Flight Simulator.
2016 FutureLighthouse. All Rights Reserved
The Sky
The sky has been a challenge to render ever since the first 3D graphics in games. It’s so important in the look of a scene: as you say, it takes up a lot of onscreen real estate. But also because it’s part of our everyday experience: so we instinctively know what looks “right” as well as what looks good. And finally, because it’s often the main source of light in a scene – whether from sunlight or ambient lighting, so the sky can affect the whole feeling of a scenario.
©2016 Michael Gerard. All Rights Reserved
TrueSky
TrueSKY works a little bit like a post-processor. We take the rendered scene, including the depth buffer. We render the clouds to a lower-resolution buffer using a bespoke real-time raytracing algorithm, and we create tables of atmospheric scattering that change over time. Then each frame we composite all these elements together with the full-resolution image. Using depth information, we can blend volumetric clouds in between 3D objects and scenery, so although the clouds are lower-resolution, they occupy real space in the scene. We’ve done a lot of work lately to ensure that it works well with VR – Everest VR from Solfar is a great showcase for this.
How do you make light and dark play with the environment?
We take engine-side light actors and update their colour, direction, and intensity. Cloud shadows are applied to the directional light so you can move in and out of sunlight even without changing the weather. Ambient lighting is hugely important in rendering – so we constantly update both the diffuse and specular ambient light to take account of the current time of day, the weather and geographic conditions. This varies from engine to engine: some game engines have no real-time ambient light system so we had to build it engine-side. And we’ve worked hard to integrate trueSKY with global illumination systems like Enlighten: often these come as plugins, which aren’t necessarily built to expect dynamic input like trueSKY provides.
God rays
I love god rays! Or “crepuscular rays” as they’re called in meteorological terms. But they are really hard to get correct, because they’re fundamentally volumetric: they come from clouds casting shadows on the air. So for us it’s a trade-off between the quality of the effect and performance. The screen-space godrays you see in many games are beautiful, but that’s a post-process effect that doesn’t really represent the physics of what’s going on: there would be no point in us re-implementing that kind of effect, people expect us to dig deeper. So we’re essentially setting up a third volumetric space (after the cloudspace and the atmospheric inscatter), raytracing through the clouds to illuminate it, then using a lookup in the final compositor to apply the godray shadows. Like most things in trueSKY, it’s adjustable for performance.
Changes
UE4 has some greate physically-based rendering in its main pipeline, which is a really good fit for our approach. You can enable trueSKY by installing the plugin, then adding a trueSKY Sequence Actor to the Level. Then you assign a trueSKY Asset to the Actor. You can change assets at any time, either instantly, or gradually with real-time updates. The assets themselves have keyframes, but you can also modify them dynamically. Blueprint allows you to script weather changes based on gameplay states, so you can make things fully dynamic, changing either the entire asset, or modifying keyframe values for gradual dynamic weather changes.
How do layers work with the clouds?
In trueSKY up till now (version 4.1) we’ve had two layers, one 2D cloud layer at high altitude (e.g. cirrus clouds), and a 3D layer. TrueSKY 4.2 (released September 2017, but available for testing now) represents a departure: now we have multiple 3D cloud layers of different types – there’s no set limit – that can overlap, covering a 600km visible volume around the camera. In 4.2, there are no 2D cloud layers – we’ve found a way to render cirrus and other thin, high-altitude cloud formations volumetrically. And instead of repeating horizontally, you can have completely different weather in different parts of your game-world: you can have a clear sky overhead, but a gathering storm in the distance. But more than that, you see that storm building as you approach it, seamlessly transitioning from one state to the other.
Using the sky for a game
TrueSKY can provide weather for any type of game where you can see the sky. One thing we’re working towards in the 4.2 release is the idea that, when the weather is changing very slowly, the CPU and GPU usage can be very minimal: almost as low as using a static texture. So you can use it as a default background without too much worrying about performance, and introduce dynamic behaviour where needed.
©2016 LippyKid. All Rights Reserved
Moody virtual places
We’ve seen some extraordinary work with trueSKY in non-realistic contexts: alien worlds, green skies, bizarre cloud formations. And we’re introducing more features to support this kind of application: you can set the sky colours directly, and trueSKY will blend them convincingly to the horizon. In rendering, it’s good to be able to start from reality, no matter how far you diverge, because it gives you a grounding and a point of reference. So that’s what we aim to provide, along with the tools to create whatever sky you can imagine.