Sponsored By

Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs.

"Afterlight" has a strong narrative aspect that its achieved by a carefully balanced mix of actual Titan's documentation and its creative interpretation. Here it is a technical breakdown about its lighting and environment

Vic Franco, Blogger

May 22, 2019

6 Min Read

For "Afterlight" we want to take what's interesting about the real atmospher and environment from Saturn's moon Titan. We think those relevant elements can help us configure a proper frame for symbolic and metaphorical agents. Here we are going to talk about how we have achieved those plastic aspects by the technical approach.

Approach to Lighting and environment. Particles and Fog

At first we wanted to simulate the environment and lighting as realistically as possible. So after a research of Titan’s luminity, we started to recreate it in Unity with approximate lumens.

The result was undesirable: almost pure darkness. In Afterlight, we want to bring extraterrestrial landscapes with natural lighting.

That way we opted to represent the Titan’s ambient and atmosphere by taking some concepts of Tarkovsky’s cinematography  -in which the environment and texture are very important.

To do that, we used as the screen space fog from the post processing stack in Unity a base and the NGSS’ ultra soft shadows from Psychose Interactive Inc. (available here: [x]). The fog simulates very well the environment’s density in deep; and the shadows, the effects of light through the fog.

In addition, in a second layer, we introduced two particle systems: one for a localized fog; and another one for the suspended particles.

The localized fog is achieved by a custom shader inspired by the one used in Playdead’s Inside smoke effects and subaquatic foam (video here: [x])

That shader uses a texture sheet for a first pass of variety, but also has a light UV deformation as well as some scroll animation in the same direction as the particle moves. We achieve that by using the vertex stream from the particle system from Unity (documentation here: [x])

Currently, we are prototyping a volumetric fog system to reduce the high overdraw that means the smoke particles as they conform big cumulus of fog.

The suspended particles' principle is very simple: motion and rotation are noise based; then you just need to add a texture sheet to get some extra variety.

Atmosphere Breakdown

We think in the near future these CPU particles will be replaced by GPU ones, in order to get millions of them without high CPU cost.

Terrain deformation

One of the most interesting features in the Titan’s environment is that its surface is covered by iced hydrocarbon dunes. This makes a deformable terrain mandatory, in which the character can leave her footprints.

To do that, we draw decals over a render texture to generate the highmap for the footsteps. By a raycast emission we can obtain the position into the terrain’s UV to draw the decal into the given position with a custom shader. That shader make the decals blend into each other. In the end, the heightmap is blurred and then dissolved by another shader.

The heightmap moves the terrain’s vertex, and of course, the shader has a very high level of tesselation to do that. Thanks to it, the deformation has a lot of detail.

Finally, the terrain’s normals are calculated with the DICE’s method shown in Battlefield 3 (documentation here, pages 42-43: [x]). This is a very simple method and assures pretty good normals for deformation lighting.

Surface - Icy sand

The surface shader is highly inspired by the appeal of Journey’s sand (video here: [x]). To make it work we need four steps:

First of all, we need a ripple mark normal map. That makes the dune does not appear plain and monotone.

Second, we need a granulated normal map that gives a grungy noise.

Third, we work on the specularity, which is masked with a fresnel previously obtained with the previous normals and the view direction.

And fourth, to get the sparkly appearance on the surface, we need a white noise texture animated depending on the view direction as well.

Sand Breakdown

Rocks translucency

To make the Titan’s rocks look properly icy, we made a custom translucency shader by using the effect known as subsurface scattering. To achieve that, we took some tips from the technique used by DICE for Battlefield 3 (documentation here: [x]). It's a cheap and cool way to get that translucent look.

Furthermore, it was necessary to show some kind of structure inside the icy rocks -like cracks. So we simulated that by using parallax mapping.

Our main character Xin changes her appearance when she comes into the facilities. In there she wears a “space pajama”, and to highlight the difference between the outfits, we use the same technique as we use for the rocks. That way we can get a more organic type look -and make her stand out in the darkest scenarios.

Liquid Methane

Liquid bodies in Titan’s surface, such as lakes and seas, are based on liquid methane. To make a proper effect to simulate that, we’ve taken a look at the layered water rendering techniques in Playdead’s Inside (video here: [x]). The effect is split in two parts: first comes the surface material of the liquid; and then, the particles that are going to interact with this surface.

The surface is layered as well:

First, we need to blend the surface with the other elements. To do that, we use the Alpha Blending mode.

Second, the smooth intersection is achieved by comparing the camera depth texture and the current surface depth (documentation here: [x]). This is the same system used for the “soft particles”.

Third, we use a typical water foam for the intersection. To get the foam effect, we use a similar technique as the smooth intersection. To give it variety and movement, we use the same technique as for the layered noise: a foam texture is copied into layers that are animated separately and blend into each other.

Fourth, we work in the subaquatic distortion: refraction. The surface takes what's rendered behind it and projects it again with distorted UVs by the surface’s normal map.

Fifth, we are doing the reflection effect. To do that, we use planar reflections by a secondary camera; which is designated to render part of the reflection to be projected then as a texture over the surface. That texture is also distorted by the normal map.

Finally, the surface is nuanced by a subtle Ocean Specular.

Liquid Methane Breakdown

The surface particles share some common features with the surface shader.

There are three kind of different particles: ripples, foam and splashes. Ripples are a ring-shaped texture that simply expands from their birth; and they use the same kind of distortion as the surface. With their ring-shaped normals, they blend into the underlying surface, adding to it.

The foam is the same of the surface, but it inherit the same growing animation as the ripples.

Finally, the splash particles are emission and size regulated depending on the movement speed of the agent that generates them upon the surface.

Read more about:

Featured Blogs

About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like