
Subsurface Scattering (SSS) in Evergine

Introduction
Evergine has integrated support for solutions for subsurface scattering (SSS), an important feature for achieving photorealistic materials. This will bring a significant advance in portraying complex materials like skin, wax, marble,e and other translucent surfaces where light penetrates and scatters beneath the surface before emerging.
What is SSS?

Figure 1 Different translucent materials (skin, wax, and leaves)
Subsurface scattering (SSS) is a mechanism that explains the way light interacts with translucent or semi-transparent material. Unlike standard shading models that only consider the surface reflection, SSS considers how light enters a material, bounces within it, and exits at different points. This effect is critical for capturing the soft, diffused glow characteristic of organic and translucent objects, making them appear more lifelike.

Figure 2 Differences in the light behaviour between standard and sss surfaces.
Evergine real-time implementation
Right now, it’s not possible to render physically accurate SSS in real-time. However, Evergine uses an optimized SSS solution that balances both performance and realism. We took inspiration from the solution created by Jorge Jimenez, as explained in this article.
To do this, we’ve created a new SSSEffect in Evergine, and we’ve broken the SSS rendering into two different areas:
Transmittance (Translucency)

Figure 3 Characteristic skin transmittance in the ear.
Transmittance is the phenomenon where light passes through a translucent object, commonly observed in areas like the ears and nostrils.
This is implemented in the new SSSEffect, using the shadow map of the light. For each pixel, we calculate the distance between the rendered pixel and the shadow map depth. This helps us know how thick the surface is at that point, allowing us to calculate how much light can pass through.
The next diagram illustrates these concepts:

Figure 4 The points z1 and z2 are projected into the light’s shadow map allowing us to calculate the depth of both points.
To complete this effect, we set a distance limit and used a gradient function to tint the light.
Diffuse Blur
This effect relies on an efficient Compute Shader (SSSBlur) that applies a diffuse blur in Screen Space using a diffusion profile, resulting in a colorful effect. It excels at softening skin details and simulating light scattering.
To achieve this, the SSSEffect calculates the strength of the blur effect (based on shader parameters) and stores it in the GBufferPass’s Distortion attachment, specifically in the B channel. Then, the DefaultPostprocessing Graph uses this texture and applies two SSSBlur passes (horizontal and vertical), using the normal texture, depth, and camera field of view to produce the final result.

Figure 5 Final result with both rendering techniques applied.
Creating SSS materials in your project
Adding SSS properties to your materials is easy, just follow these instructions (in Evergine Studio):
- Open a material or create a new one. Select it to launch Material Editor.
- Click on the FX combo box to open the list of available Effects of your project.
- Select This will keep the previous parameters from a StandardEffect.
- Customize your material with the following parameters:
- SSS Scatter: (0.045 by default) Defines the “width” of the SSS effect, or the maximum distance light can scatter through the surface.
- SSS Intensity: (0.1 by default) Controls the strength of the effect.
- SSS Bias: (0.003 by default) Adjusts the distance to shrink for calculating transmittance, helping to avoid artifacts (like depth bias in shadow mapping).
- SSS Translucency Color: (D05749FF by default) The color of the transmittance effect.
- SSS Translucency Texture: A color texture used to adjust the translucency color in different areas of your model.
- SSS Scatter Texture: Applies a multiplication factor to the SSS Scatter parameter, allowing variations in surface thickness.
- The next step will be to add a Postprocessing Graph entity into your scene.
- Select the postprocessing graph entity. In the SSS tab, check the Enabled This will enable the SSS diffuse blur.
- Adjust its parameters:
- Quality: Sets the amount of blur samples per pass. 3 options:
- SSS_QUALITY_OFF
- SSS_QUALITY_1
- SSS_QUALITY_2
- SSS Width Factor: (0.075 by default) The correction factor from the SSS Scatter parameter from the material.
- Quality: Sets the amount of blur samples per pass. 3 options:
Once you’ve configured both your material and postprocessing parameters, you can achieve impressive results like this beautiful hand.
In summary, the implementation of SSS is another step toward our goal of creating realistic characters and avatars that can interact with the user and feel alive. Stay tuned for more updates!