Roughness model and microfacet theory
4.10.1. Background and theory
Based on Fresnel’s equations and Snell’s law, the theory presented so far allows accurate modelling of reflection and refraction (transmission) for many opaque and transparent surfaces, such as glass, metal, marble and other polished surfaces. The models will provide an accurate description of the scattering of light at the surface of these materials and, therefore, will also allow a photorealistic appearance of the surface if used for raytracing. However, the majority of surfaces show significant diffuse reflection. This effect cannot be described (or modelled in raytracing) by only applying Fresnel’s approach, as this would lead to a purely specular reflection. Mainly two processes are responsible for diffuse reflection: surface roughness and subsurface scattering. The latter process will be covered in the next section, while this section covers surface roughness.
Surfaces can be modelled directly with the Fresnel approach as long as their boundary is ideally flat or ideally smooth, i.e. locally flat. While the production or finishing processes for glass and metals result in a smooth surface, most naturally occurring surfaces will not fulfil this condition. An important – and presumably the only – exception to this is the still surface of water, ice, or other liquids. While Fresnel’s equation and Snell’s law are still valid on a microscopic scale for most naturally rough surfaces, they cannot directly be applied by using the macroscopic orientation of the surface only. A statistical approach is required to model the uneven surface. If this distribution of the varying surface orientations is considered appropriately, most of the rough surfaces can still be modelled using the Fresnel approach. The implementation of diffuse reflection via microfacet modelling further allows considering the polarisation state of the diffusely reflected or refracted radiation, as the complete Fresnel calculation is applied for every micro-surface.
However, it should be noted here that the Fresnel model can also break down for some regular or nanostructured surfaces with structural dimensions in the range of the wavelengths, as in the derivation of Fresnel’s equations, homogeneous electromagnetic properties are assumed for the two media that form the interface.
4.10.1.1. Microfacet models
The adaptation required for rough surfaces is performed by replacing the constant normal vector of the macrosurface 𝑛⃗ with statistically distributed normal vectors 𝑚⃗⃗ describing the orientation of microsurfaces or microfacets (Figure 42). This approach is called the microfacet model. The model can, of course, not be used to reconstruct the actual

topology of the surface accurately. It only provides distributions relevant for modelling the surface’s directional reflection and transmission profiles, based on optical geometry assumptions. The model can therefore be regarded as randomly oriented, specularly reflecting facets (mirrors), whereby the orientations of the facets follow a distribution determined by a roughness parameter.
The microfacet model was introduced by Cook and Torrance (1982) for rendering in computer graphics. Based on this work, many authors have proposed variations or computationally cheaper implementations. Significant improvements were, e.g. provided by Ward (1992), Schlick (1994), Walter et al. (2007) as well as by Ashikhmin and Shirley (2011). Most of the early approaches, which Figure 42 Microfacet and macrosurface normal vectors Light, sun and optics – applied principles, models and methods RadiCal, D. Rüdisser 81 are still widely used, do not satisfy energy conservation since the main purpose of the models is to allow computer graphics rendering with high computational efficiency.
4.10.1.2. Shadowing and masking
While the different versions show some alterations, usually, the microfacet models consist of three components: a distribution of microfacets surface normals 𝐷(𝑚⃗⃗ ), a shadowing function and a masking function. The distribution of surface normals 𝐷(𝑚⃗⃗ ) depends on a roughness parameter and describes the orientations of the microfacets. In order to determine the visible facets 𝐷(𝑚⃗⃗ ) has to be masked by a masking function, which depends on the viewing angle in backward raytracing. In the forward raytracing approach applied in the RadiCal method, this corresponds to the angle of the incident light 𝑣𝑖 ⃗ . Applying this masking function 𝐺1 (𝑣𝑖 ⃗ , 𝑚⃗⃗ ) to the distribution of surface normals 𝐷(𝑚⃗⃗ ) the distribution of visible surface normal 𝐷𝑣 (𝑚⃗⃗ ) is obtained. This distribution has to be sampled for any incoming ray to identify the correct orientation of the microfacet. The Fresnel coefficients are then determined for the reflection on the microfacet. If the ray is reflected, a second function, called the shadowing function, is applied to detect if another microfacet blocks the outgoing ray. Since in computer graphics, usually only one collision (or “bounce”) of the ray on a surface is considered, the two functions are often combined to form a shadowing-masking function 𝐺2 (𝑣𝑖 ⃗ , 𝑣⃗ 𝑜 , 𝑚⃗⃗ ). This function depends on the incoming and outgoing direction and determines if the considered ray is unobstructed and, thus, should be used to sample the surface’s appearance.
In a simple approach, the masking function 𝐺1 can be used to construct the shadowing-masking function

In this approach, the model is referred to as uncorrelated surface, as the orientations of neighbouring microfacets are assumed to show no correlation. On a more detailed look, it becomes evident that depending on the assumed topology, correlation relations must be considered. Therefore, the shadowing function for the outgoing ray has to depend on the orientation of the hit microfacet. For such correlated surfaces, equation (68) will not hold, and 𝐺2 (𝑣𝑖 ⃗ , 𝑣⃗ 𝑜 , 𝑚⃗⃗ ) has to be provided in closed form. In the implementation of the RadiCal raytracer, forward raytracing is applied. Contrary to the standard rendering approach using back-tracing, the masking function determines the illuminated microfacet, whereas the shadowing function determines if the reflection path is unobstructed. In the RadiCal approach, every ray is followed from “cradle to grave” to ensure energy conservation. Hence, unlike in the standard rendering methods, it is not possible to simply omit obstructed light paths as usually applied with shadowing-making functions. Since usually only the implicit shadowing-masking function and masking functions are provided, they are used to evaluate the shadowing function 𝐺𝑠 :

Expressed in terms of probability, it can be stated that the probability of an obstruction in the
outgoing direction (𝐺𝑠) is obtained by dividing the probability of obstruction on either path (𝐺2) by
the probability of the obstruction for the incoming path (𝐺1).
4.10.1.3. Implementation of the Heitz Smith GGX model
While many different BSDF models are available, most do not meet the requirements of the implemented Monte-Carlo method. For rendering purposes, usually, importance sampling is applied, i.e. many rays are computed and weighted, or rejected, according to the masking and shadowing functions. For the use in the RadiCal raytracer, however, it is essential to use a model which explicitly and always provides a statistically distributed surface normal orientation for any incident direction. In the year 2014 Heitz and d’Eon (2014a, 2014b) introduced a very efficient method which allows direct sampling of the distribution of visible surface normals 𝐷𝑣 (𝑚⃗⃗ ) for V-cavity or Smith surfaces. Instead of sampling the distribution of normals first and then weighting the normals according to the masking function, the weighted distribution can directly be sampled in a single step. Three years later Eric Heitz (2017) developed the method further and proposed a new algorithm, which not only simplifies the implementation but also significantly improves the algorithm’s efficiency even further. The suggested method has been implemented, and the widely used GGX distribution of normals has been used in this first version of the RadiCal raytracer. It allows to modelling of correlated and uncorrelated surface topologies defined by one isotropic or two anisotropic dimensionless roughness parameters.
The corresponding masking function 𝐺1 (𝑣 , 𝑚⃗⃗ ) for the Smith GGX surface is(Heitz, 2014)

Is the positive Heaviside function which returns +1 for positive values and 0 for negative arguments. It is used to remove any back-facing normal of the distribution.
For the case of uncorrelated surface roughness, the related masking-shadowing function 𝐺2 (𝑣𝑖 ⃗ , 𝑣⃗ 𝑜 , 𝑚⃗⃗ ) can be written as

For the correlated case, Heitz (2014) suggests the following relation, which considers height correlation:

As mentioned above, the shadowing-function is explicitly in the RadiCal implementation. While the shadowing-function 𝐺𝑠 matches the masking function 𝐺1 in the uncorrelated case, equation (69) is used to derive 𝐺𝑠 of 𝐺1 and 𝐺2.
The distribution of visible surface normals 𝐷𝑣 (𝑚⃗⃗ ) has been implemented based on the very efficient sampling algorithm provided by Heitz and D’Eon (2014a) and subsequently improved by Heitz (2017). Its implementation is provided in the next section.

The shadowing function is required to check if the outgoing ray is blocked. For the correlated surface the function SmithGGX_ShadowingCorr is used for that purpose. It is an implementation of equation (69) using (77) and (79). For the uncorrelated case, the masking function implemented in SmithGGX_G1 can be used directly. To increase computational performance, the tangent function call is replaced with an equivalent vector expression.

4.10.3. Testing and validation
In order to test the implemented algorithm, the reflection and transmission profile of float-glass and silver surfaces with different roughness values were analysed. Unpolarised light with a wavelength of 500 nm was used for incidence. The implementation and the calculation results were also briefly discussed with Eric Heitz, the author of the relevant publications.
The following polar plot representations show the reflected and transmitted angularly resolved radiance values. To be able to present the results within a single chart, the square root of the radiance values is used as the radius parameter for the polar plots. For the polar plots, only the correlated model was applied.
Figure 43 depicts the scattering of light for three different angles of incidence (grey: 10°, violet: 45°, red: 80°) and three different roughness values (left: 0.1, centre: 0.3, right: 1.0). It can be seen that most of the energy is transmitted below the surface. The surface roughness leads to a broadening of the transmitted and refracted beam, increasing with surface roughness. Likewise, the reflection on the surface is broadened/diffused. Consistent with the Fresnel equations, the reflectance generally rises with a higher angle of incidence. However, the effect is mitigated by a high roughness of the surface.

Figure 44 provides a closer view of the centre case of Figure 43. It can be seen that most of the incoming light is transmitted and refracted below the surface. While Snell’s law determines the angle of refraction, the transmitted beam is broadened due to the variation of the surface normal. It can also be seen that the occurrence of secondary surface bounces adds a little “collar” to the lobe of the transmitted beam. This indicates that the secondary bounces enable an additional and even broader diffusion of the transmitted light into regions that would, due to the law of refraction, not be accessible on the first scattering process. However, from a quantitative point of view, the diffusion by multiple scattering events is very limited

Analysing the reflectance of the rough silver surfaces, a generally higher reflectance and, therefore, a weaker dependence of the reflectance on incidence angle and roughness is observed. The significant effect of the surface roughness is that the reflectance loses its directional component, as can clearly be seen in Figure 45. The roughest case (right) does not show any specular reflection. The reflected light is equally diffused in all directions.


In order to analyse the difference between the correlated roughness model vs. the uncorrelated approach, the reflection on a silver surface with a roughness value of 1.0 (at an incidence angle of 45°) is analysed using both models. As shown in Figure 47, the consideration of correlation, on the one hand, reduces the intensity of the reflection towards the surface-normal, while the radiance in directions more parallel to the surfaces is increased. The uncorrelated model results in an ideal Lambertian reflection profile. The polar plot representation shows a perfect spherelike structure, as can be expected for a Lambertian surface. However, the root-square scaling approach in the presented figure slightly distorts the sphere.

In order to quantify the simulation results the reflectance was integrated over the entire hemisphere to determine the spectral directional-hemispheric reflectance (SDHR). Table 8 provides the total reflectance values for all cases depicted above.

Additionally, the SDHR values were determined as a function of the roughness parameter for both surface materials and the six incidence cases each (see Figure 48).

It can be seen that the reflectance of the surface is generally reduced with increasing roughness. This effect is particularly pronounced for the reflection off the glass with the high incidence angle (80°). In this case, the reflectance reduces from approx. 40% for the flat surface to almost 5% for the rough surface. The results further show that choosing either the correlated or uncorrelated surface model for the float-glass has little effect on the generally low reflectance.
On the highly reflective silver surface, the reflectance decrease with roughness is generally lower, albeit clearly visible. Choosing the correlated model leads to apparently higher reflectance values; however, the absolute reflectance increase is only 0.5% at most. The reason for this increase can be identified if the average number of bounces on the surface structure is evaluated (not listed here): for the rough surface and incidence angle 80° the average number of bounces for each ray is lowered from 1.66 to 1.36 if the correlated model is chosen. This indicates that the different distribution of microfacet orientations allows the ray of light to exit more easily, reducing potential absorption.
Another less quantitative but powerful test for the validity of the implementation is the generation of rendered images, as the eye is very sensitive to inaccurate representations or singular errors. For this purpose, the raytracing algorithm is used in backward mode (see section 7.11). As can be seen in Figure 49, the microfacet algorithm provides a realistic appearance for transparent and opaque materials. It can also be seen that a roughness value of 0.3 already provides a pronounced, ”sandblasted” appearance of the surfaces. This indicates that higher values for are less relevant for realistic modelling of surfaces.
