Light is a complex phenomenon because it can have both wave and particle properties. Light play in the creation processes of a 3D configurator a important role.

Texture artists are interested in the radiation model of light because it describes the interaction of light and matter. It is important to understand how light rays interact with surface material because the task is to create textures that describe a surface. The textures and materials we write interact with light in our virtual worlds. The better the understanding of how light behaves, the better the textures will look.

In this guide, we will discuss the theory behind the physics of PBR models, we will start by studying the behaviour of light rays and work through to defining the most important properties of PBR.

Light rays.

The light beam model states that a light beam has the trajectory of a straight line in a homogeneous transparent medium such as air. The model also states that the beam behaves more predictably whent it hits surfaces such as opaque objects or when it passes through another medium such as air or water.

This makes it possible to visualize the path of the light beam as it moves from its starting point to another point where it transforms into another form of energy, such as heat.

lichtstrahlen e

A beam of light hits a flat interface between two media. When a beam of light hits a surface, one or both of the following events may occur:

  • The light beam is reflected from the surface and moves in a different direction. It follows the law of reflection, which states that the angle of reflection is equal to the angle of incidence (reflecting light).
  • The light beam goes from one medium to another in the trajectory of a straight line (refracted light).
  • At this point, the light rays divide in two directions: Reflection and Refraction. At the surface, the ray is either reflected or refracted and can eventually be absorbed by both media. However, the absorption does not take place on the surface of the material.

Absorption and scattering (transparency and transculence).

When traveling in an inhomogenous medium or transculent materal, light can be absordbed or scattered.

When light is absorbed, light intensity decreases when it passes into another form of energy – usually heat. Its color changes because the amount of light absorbed depends on the wavelenght, but the direction of the beam does not change.

When light is scattered, the direction of the beam changes randomly and the amount of softening depends on the material. The scattering changes the direction of the light, but not the intensity. An ear is a good example of this phenomenon. The ear is thin, so you can see the scattered light from the back of the ear.

If there is no scattering and the absorption is low, the rays can penetrate directly through the surface. This is the case with glass. Imagine, for example, swimming in a clean pool. You can open your eyes and see a great distance through the clear water. However, if the same pool is relatively dirty, the dirt particles scatter the light and reduce the clarity of the water and the distance you can see is reduced.

The further the light travels in such a medium/material, the more it is absorbed and/or scattered. Therefore, the thickness of the object plays an important role in how much light is absorbed or scattered. A Thickness Map can be used to describe the object thickness for the shader.

lichtstreuung e

Diffuse and reflective reflection.

The mirror reflection refers to light reflected at the surface, as we have already discussed in the Light Beam section. The light beam is reflected from the surface and moves in a different direction. It follows the law of reflection, which states that on a perfectly flat surface the angle of reflection is equal to the angle of incidence. However, most surfaces are irregular and the reflected direction varies depending on surface roughness. This changes the direction of the light, but the light intensity remains constant.

Rough surfaces haver larger lights that appear darker. Smoother surfaces focus the reflections and appear brighter or more intense from the right angle. However, in both cases the same total amount of light is reflected.

Refraction is a change in the direction of a light beam. When light moves from one medium to another, it changes speed and direction. The refractive index is an optical measurement that describes the change in the direction of movement of a light beam. Essentially, the refractive index is used to determine how strongly the beam is bent when it passes through one medium to another. For example, water has a refractive index of 1.33, while glass has a refractive index of 1.52. The figure shows a straw in a glass of water. The straw seems to be bent by refraction when the light passes through different media.

strohhalm brechung e

Diffuse relection is refracted light. The light beam passes from one medium to another. As an example, we assume that it enters an object. The light is then scattered several times in this object. It is finally refracted from the object again and returns to the original medium at the point where it originally entered.

Diffuse materials are absorbent. If the refracted light moves too long in such a material, it can be completely absorbed. When the light exits this material, it is likely to have travelled a very short distance from the point of entry.

Therefore, the distance between the entry and exit points can be considered negligible. The Lambertain model, which is used for diffuse reflection in the traditional sense of shading, does not take surface roughness into account. However, other diffuse reflection models, such as the Oren-Nayar model, contribute to this roughness.

Materials with both high scattering and low absorption are sometimes referred to as participating media or transculent materials. Examples are smoke, milk, skin, jade and marble. The representation of the latter three may be possible with the additional modeling of subsurface scattering if the difference between the entry and exit points of the light beam is no longer considered negligible. The accurate reproduction of media with very different and very low scattering and absorption, such as smoke or mist, may require even more expensive methods such as Monte Carlo simulations.

Microfacet Theory.

Theoretically, both diffuse and specular reflections depend on the surface irregularities in which the light rays intersect with a medium. In practice, however, the influence of roughness on diffuse reflection is also less visible due to the scattering that occurs in the material. As a result, the exit direction of the beam is largely independent of the surface roughness and the direction of incidence. The most common model for diffuse eflection completely neglects roughness.

In this guide, we refer to these surface irregularities as surface roughness. Surface irregularities can have several other names depending on the PBR workflow used, including roughness, smoothness, gloss or microsurface. All these terms describe the same aspect of a surface, namely the geometric detail of a subtexel.

Depending on the workflow used, these surface irregularities are recorded in the Roughness or Glossiness Map. A physically based BRDF is based on the microfacet theory, which assumes that a surface consists of small-scale, planar detail surfaces of different orientation, the so-called micro-facets. Each of these small planes reflects the light in one direction, based on its normal.

Micro-facets, whose surface normals are aligned exactly in the middle between light and viewing direction, reflect visible light. However, in cases where the micro-surface is normale and the semi-normal is the same, not all micro-facets contribute, as some are blocked by shadowing or masking.

Surface irregularities at the microscopic level cause light scattering. For example, blurred reflections are caused by scattered light. The rays are not reflected parallel, so that we perceive the reflection as blurred.

Colours.

The visible color of a surface is due to the wavelenghts emitted by the light source. These wavelenghts are absorbed by the object and reflected both specularly and diffusely. The remaining reflected wavelenghts are what we see as color.

For example, the skin of an apple usually reflects red light. Only the red wavelenghts are scattered back outside the shell of the apple, while the others are absorbed.

The apple also has bright highlights in the same color as the light source, because with materials that do not conduct electricity, the reflection is almost wavelenght-independent. With these materials, the reflection is never colored. We will discuss the different types of materials in later sections.

Substance PBR shaders use the GGX Micro-Facet distribution.

Birectional Reflection Distribution function (BRDF).

A bi-directional reflection distribution function (BRDF) is a function that describes the reflection property of a surface. In computer graphics, there are several BRDF models, some of which are physically implausible. For a BRDF to be physically plausible, it must be energy efficient and reciprocal. Reciprocity refers to the Helmholtz reciprocity principle, which states that incoming and outgoing light beams can be regarded as reversals without affecting the result of the BRDF.

The BRDFs used by Substance`s PBR shaders are based on Disney`s principle reflection model. This model is based on the GGX micro facet distribution. GGX offers one of the better solutions in terms of mirror distribution: with a shorter peak in the highlight and a longer tail in the falloff, it looks more realistic.

Energy saving.

Energy saving plays a decisive role in PBR-based solutions. The principle means that the total amount of light re-emitted from a surface is less than the total amount of light received. In other words, the light reflected from the surface will never be more intense than before it hits the surface. As artists, we don`t have to worry about controlling energy saving. This is one of the advantages of PBR: the energy saving is always forced by the shader. This is part of the PBR model and allows us to concentrate on art without having to study physics.

Fresnel effect.

The Fresnel reflection factor also plays an important role in physical-based shading as a coefficient of the BRDF. The Fresnel effect, as observed by the Franch ohysicist Augustin-Jean Fresnel, states that the amount of light reflected from a surface depends on the angle at which it is perceived. Think of a water basin. If you look down perpendicular to the water surface, you can look down. Looking at the warer surface in this way would be at zero degrees or normal incidence, where normal is the surface normal. If you look at the water basin at a grazing incidence, rather parallel to the water surface, you can see that the reflections on the water surface become more intense and you can no longer see under the water surface.

Fresnel is not something we control in PBR, as we did in traditional shading. This is another aspect of physics covered by the PBR shader. If you look at one surface at a strip incidence, all smoothed surfaces becomes almost 100% reflectors at an angle of incidence of 90 degrees.

With rough surfaces, the reflectivity becomes increasingly reflective, but not nearly 100%. The most important factor is the angle between the normal of each micro surface and the normal of each micro surface and the light. Since the light rays are scattered in different directions, the reflection appears softer or darker. What happens ar the macroscopic level is similar to the average of all Fresnel effects you would observe for the collective micro-facets.

F0 (Fresnel reflection at 0 degrees).

If light hits a surface straight or perpendicular, a percentage of this light is reflected as a mirror. From the refractive index of a surface one can derive the amount that is reflected. This is called F0. The amount of light refracted into the surface is called 1-F0.

The F0 range for most common dielectrics in between 0.02 and 0.05. For conductors, the F0 range uis 0.5-1.0. The reflectivity of a surface is therefore determined by the refractive index, as shown in the following equation:

F(0°) = (n-1)²/(n+1) ² = 0.02

It is the F0 reflection value that we are concerned with when creating our textures. Non-metals (dielectrics / insulators) have a grey value and metals an RGB value. With respect to PBR and an artistic interpretation of reflectivity, we can state that F0 reflects between 2% and 5% of the light and 100% at the angle of dispersion on a common smooth dielectric surface.

The dielectric reflectance values actually do not change very much. In fact, if they are changed by roughness, the actual value changes may be difficult to detect. However, there is a difefrence in the values.

Note that the ranges for non-metals are not drastically different. Gemstones are an exception because they have higher values. On F0, since it refers specifically to conductors and insulators, we will discuss a littler later.

Conductors and insulators (metals and non-metals).

When creating materials for PRB, it is helpful to think in terms of metal or non-metal. As yourself whether the surface is metal or not. If this is the case, you must follow a number of guidelines. Of this is not the case, you must follow another.

This can be a simlistic approach, as some materials do not fall into these categories, such as metalloids, but throughout the material manufacturing process the distinction between metal and non-metal is a good approach and metalloids are an exception. In order to establish guidelines for materials, we must first understand what we are trying to create. With PBR we can look at the properties of metals and non-metals to derive these guidelines.

Refracted light is absorbed and the hue of the metals comes from the reflected light, so we do not give our maps diffuse colors to the metals.

Metals.

Metals are good conductors of heat and electricity. The electric field in conductive metals is zero and when an incident light wave of electric and magnetic fields hits the surface, the wave is partially reflected and all refracted light is absorbed. The reflection value for polished metal is high and ranges from about 70 to 100%.

Some metals absorb light with different wavelenghts. For example, good absorbs blue light at the high frequency end of the visible spectrum so that it appears yellow. However, since the refracted light is absorbed, the hue of the metals comes from the reflected light. In our maps we therefore do not give metals a diffuse color. For example, in the mirror/glass workflow, the raw metal is set to black in the diffuse map and the reflection value is a tinted color value in the specular map. For metals, the reflection value is RGB and can be colored. Since we work within a physically based model, we have to use real measured values for the metal reflectance in our maps.

Another important aspect of metals in terms of texturing is their tendency to corrosion. This means that waethering elements can play a large role in the reflectivity of metal. When the metal rust, the reflection state of the metal changes. The corroded areas are then treated like a dielectric metal, which is characterized by a black level in the metal map. As we will discuss later, the shader in the Metallic/Roughness workflow is set to reflect the F0 value for dielectrics to 4%.

In addition, painted metal is treated as dielectric and not as metal. The paint acts as a layer on the raw metal. Only the raw metal exposed by the broken paint is treated as metal. The same applies to soiling on metal or other materials that cover the raw metal.

As mentioned at the beginning of this chapter, it is helpful to ask whether a material is a metal or not when creating PBR materials. More specifically, the question should also include information about the condition of the metal: whether it is painted, rusted or covered with other materials such as dirt or grease. The material is treated as a dielectric if it is not a crude metal. Depending on wathering, there may be mixing between metal and non-metal, since weathering elements play a role in the reflective state of a metal.

Non metals.

Non-metals are bad conductors. The refracted light is scattered and/or absorbed so that they reflect much less light than metals and have an albedo colour.

We have already mentioned that the value for ordinary dielectrics is about 2 to 5 %, based on the F0 as calculated by the refractive index. These values are in the linear range from 0.017 to 0.067. Apart from some non-metallic materials such as gemstones, most dielectrics have no F0 value greater than 4%.

As with metals, we must use real measurements, but it can be difficult to find a refractive index for other materials that are not transparent. However, the value between the most common dielectric materials does not change dramatically, so we can use some guidelines fpr reflectance values.

Linear Space Rendering.

Linear space rendering is a high complex topic. For this guide, a simplistic approach is chosen, whoch states that Linear Space Rendering provides the right mathematics for lighting calculations. It creates an environment in which light interactions can be rendered credibly and realistically. In linear space, the gamma is 1.0 and the calculations are performed linearly in this space. In order for the rendered image to look correct to our eyes, the linear gamma must be adjusted.

Our eyes perceive changes of the light values nonlinearly, which means that they work with a gamma greater than 1.0. The human eye is more sensitive to darker tones than to lighter ones. Computer monitors take this sensitivity into account in order to display images so that we can perceive them correctly, i. e. we view colors on a monitor with a non-linear gamma or in gamme-encoded space (sRGB).

Calculations of color values and operations on colors should be performed in linear space. The process converts gamma-coded values into linear coded values from our color maps and from colors that are selected during display on a monitor using a color selector. In a color-managed workflow, this process typically involves marking a texture map that is interpreted as linear or sRGB.

The calculations are then performed in linear space and the final result is displayed in gamma-coded space (sRGB).A simpler way to take this into account is that if the map represents a color you see, such as the hue of a metal or the green color of grass, then it should be interpreted as sRGB. If the map creates data, such as how rough the surface is or if the material is metal, then it should be interpreted as linear.

Within Substance Designer and Painter, the conversion between linear/sRGB space to inputs in the shader and gamma correction to the calculated result in the rendered viewport is automatically performed. As artists, we usually don’t have to worry about linear calculation and conversion within the Substance software, as it is enabled by default.

When using substances via the Substance Integration plugin, the output is automatically marked via the integration and color management of the host application for the linear/sRGB area. However, it is important to understand the process: If Substance Maps are used as exported bitmaps and not as substances, you must manually mark the textures as sRGB or Linear, depending on the renderer used.

The formula for the correct (default) conversion from sRGB to linear is used in the Substance Painter and Substance Designer and is defined as:

if Csrgb < 0.04045
then Clin = Csrgb/12.92
otherwise Clin = (Csrgb + 0.055/1.055)2.4

At the time of this writing, the linear nodes to rgb and rgb to linear nodes in the Substance Designer do not use this formula for optimization reasons. However, this could change in a later release.

Clin = (Csrgb)2.2

Main features of PBR.

Now that we have explored the basic theory behind physics, we can deduce some key features of PBR:

Energy saving. A reflected beam is never brighter than the value it had the first time it hit the surface. The energy saving is done by the shader.

Fresnel. The BRDF is managed by the shader. The F0 reflection value has a minimal change for most common dielectrics and is in thr range  of 2 to 5%. The F0 for metals is a high value ranging from 70 to 100%.

Specular intensity is controlled by the BRDF, Roughness or Glossiness map and the F0 reflectance value.

Light calculations are calculated in linear space. All maps that have gamma-coded values such as base color or diffuse are usually converted to linear by the shader, but you may need to ensure that the conversion is performed correctly by neabling the appropriate option when importing the image into your game engine or renderer. Maps that describe surface properties such as roughness, gloss, metal, and height should be interpreted as linear.

Copy to Clipboard

At the time of this writing, the linear nodes to rgb and rgb to linear nodes in the Substance Designer do not use this formula for optimization reasons. However, this could change in a later release.

Copy to Clipboard

Main features of PBR.

Now that we have explored the basic theory behind physics, we can deduce some key features of PBR:

Energy saving. A reflected beam is never brighter than the value it had the first time it hit the surface. The energy saving is done by the shader.

Fresnel. The BRDF is managed by the shader. The F0 reflection value has a minimal change for most common dielectrics and is in the range of 2 to 5%. The F0 for metals is a high value ranging from 70 to 100%.

Specular intensity is controlled by the BRDF, Roughness or Glossiness map and the F0 reflectance value.

Light calculations are calculated in linear space. All maps that have gamma-coded values such as base color or diffuse are usually converted to linear by the shader, but you may need to ensure that the conversion is performed correctly by enabling the appropriate option when importing the image into your game engine or renderer. Maps that describe surface properties such as roughness, gloss, metal, and height should be interpreted as linear.