Fast Subsurface Scattering in Unity (Part 1)

Most (if not all) optical phenomena that materials exhibit can be replicated by simulating how the individual rays of light propagate and interact. This approach is referred in the scientific literature as ray tracing, and it is often too computationally expensive for any real-time application. Most modern engines rely on massive simplifications that, despite being unable to reproduce photorealism, can produce a believable approximation. This tutorial introduces a fast, cheap and convincing solution that can be used to simulate translucent materials which exhibit subsurface scattering.

This is a two part series:

The Mathematics of Diffraction Grating

This post introduces the mathematics behind the optical phenomenon known as diffraction grating, which is responsible for iridescent reflections in many materials.

You can find the complete series here:

A link to download the Unity project used in this series is also provided at the end of the page.

Understanding Diffraction Grating

The first post in this series, The Nature of Light, introduced the dual nature of light, exhibiting behaviours which are typical of both waves and particles. In this part, we will see how those two aspects are both necessary for iridescence to arise.

You can find the complete series here:

A link to download the Unity project used in this series is also provided at the end of the page.

Improving the Rainbow – Part 2

In the previous part of this tutorial, Improving the Rainbow – Part 1, we have seen different techniques to reproduce the colours of the rainbow procedurally. Solving this problem efficiently will allow us to simulate physically based reflections with a much higher fidelity.

The purpose of this post is to introduce a novel approach that yields better results than any of the previous solutions, without using any branching.

You can find the complete series here:

A link to download the Unity project used in this series is also provided at the end of the page.

Improving the Rainbow – Part 1

Our journey to photorealism requires us to understand not only how light works, but also how we perceive colours. How many colours are in the rainbow? And why pink is not one of them? Those are some of the questions that this post will address.

You can find the complete series here:

A link to download the Unity project used in this series is also provided at the end of the page.

The Nature of Light

This is the first part of the tutorial on iridescence. This new series will explore the very nature of light, in order to understand and to replicate how material exhibits colourful reflections. The tutorial is oriented to Unity game developers, although the techniques described can be easily implemented in other languages, including Unreal and WebGL.vi

You can find the complete series here:

Fast Subsurface Scattering in Unity (Part 2)

This is the second part of the tutorial on Fast Subsurface Scattering in Unity. This post will show a working implementation of this effect.

This is a two part series:

Following the unexpected success of the tutorial on Inverse Kinematics for Tentacles, I have decided to share the shader that I used to make them so realistic.

If you are not familiar with shaders, fear not. This tutorial will be target at beginners, and you’ll only need a basic understanding of how Unity works.

• Introduction
• Part 1. Creating a new Shader
• Part 2. Refitting the Shader
• Part 3. Normal Extrusion
• Part 4. Sucker Waves
• Part 5. Selective Extrusion
This is a tutorial for Unity 5: Unity 4 used `MaterialEditor` (legacy documentation here) to customise a material’s inspector. That is now deprecated; you should use the new `ShaderGUI` (documentation here) instead.