# A Micrograin BSDF Model for the Rendering of Porous Layers

Simon Lucas, Mickaël Ribardière, Romain Pacanowski, Pascal Barla

► To cite this version:

Simon Lucas, Mickaël Ribardière, Romain Pacanowski, Pascal Barla. A Micrograin BSDF Model for the Rendering of Porous Layers. Siggraph Asia 2023 - The 16th ACM SIGGRAPH Conference and Exhibition on Computer Graphics and Interactive Techniques in Asia, Dec 2023, Sydney, Australia. 10.1145/3610548.3618241 . hal-04220006

HAL Id: hal-04220006

https://hal.science/hal-04220006v1

Submitted on 28 Sep 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
A Micrograin BSDF Model for the Rendering of Porous Layers

SIMON LUCAS, Université de Bordeaux, INRIA, France
MICKAËL RIBARDIÈRE, Université de Poitiers, France
ROMAIN PACANOWSKI, INRIA, France
PASCAL BARLA, INRIA, France

<figure><img src="image_2.png" /><figcaption>Fig. 1. Our micrograin BSDF model provides a physically-plausible solution for laying porous layers onto an arbitrary surfaces. This is here shown for a number of materials: we use diffuse grains on a plastic watering can to reproduce mud, copper oxide grains on a metallic bucket for rust, diffuse grains on a transparent glass for dirt, gold grains on diffuse or aluminium vases to mimic spray paint, soot grains on the diffuse broken pots and diffuse grains on wooden shelves.</figcaption></figure>

We introduce a new BSDF model for the rendering of porous layers, as found on surfaces covered by dust, rust, dirt, or sprayed paint. Our approach is based on a distribution of elliptical opaque micrograins, extending the Trowbridge-Reitz (GGX) distribution [Trowbridge and Reitz 1975; Walter et al. 2007] to handle pores (i.e., spaces between micrograins). We use distance field statistics to derive the corresponding Normal Distribution Function (NDF) and Geometric Attenuation Factor (GAF), as well as a view- and light-dependent filling factor to blend between the porous and base layers. All the derived terms show excellent agreement when compared against numerical simulations.

Our approach has several advantages compared to previous work [d'Eon et al. 2023; Merillou et al. 2000; Wang et al. 2022]. First, it decouples structural and reflectance parameters, leading to an analytical single-scattering formula regardless of the choice of micrograin reflectance. Second, we show that the classical texture maps (albedo, roughness, etc) used for spatially-varying material parameters are easily retargeted to work with our model. Finally, the BRDF parameters of our model behave linearly, granting direct multi-scale rendering using classical mip mapping.

CCS Concepts: • **Computing methodologies** → **Reflectance modeling**.

**ACM Reference Format:**

Simon Lucas, Mickaël Ribardière, Romain Pacanowski, and Pascal Barla. 2023. A Micrograin BSDF Model for the Rendering of Porous Layers. In *SIGGRAPH Asia 2023 Conference Papers (SA Conference Papers '23)*, December

12-15, 2023, Sydney, NSW, Australia. ACM, New York, NY, USA, 9 pages.
https://doi.org/10.1145/3610548.3618241

# 1 INTRODUCTION

Porosity is common in natural and man-made materials. We distinguish two types of structures: granular materials such as sand or earth where many tiny grains are distributed in a volumetric fashion; and porous layers such as dust or dirt where grains are distributed onto another surface. The former type requires complex volumetric rendering techniques (e.g. [Müller et al. 2016]), or must be restricted to simpler configurations to yield suitable BRDF approximations (e.g., [d'Eon 2021; Hapke 2012]). In this paper, we focus instead on the latter type, which permits the blending of two materials (the porous layer on the base surface) with varying grazing-angle effects. Our objective is to derive a physically-based BSDF model for such material configurations.

The key idea of our approach is to consider a distribution of micrograins on a surface, from which we derive a BSDF model according to microfacet theory [Torrance and Sparrow 1967]. The micrograins are thus considered too small to be visible to the naked eye. Structures larger than a micrograin (e.g., meso-scale aggregates) should be modelled explicitly (e.g., through displacement maps). We restrict ourselves to opaque micrograins, and assume that the effect of smaller structures on light transport is modelled by the reflectance of a micrograin.

Our contribution is twofold. First, we define a microfacet Normal Distribution Function (NDF) from the distribution of micrograins in Section 4. This new NDF extends the Trowbridge-Reitz (GGX) distribution to handle porosity (i.e., the spaces between micograins). Second, we define visibility terms in Section 5: the visible filling factor (i.e., the complement of porosity) of a porous layer on a base

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

SA Conference Papers '23, December 12-15, 2023, Sydney, NSW, Australia

© 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM ISBN 979-8-4007-0315-7/23/12...$15.00

https://doi.org/10.1145/3610548.3618241
surface, as well as the Geometric Attenuation Factor (GAF) required by microfacet theory.

The main advantage of relying on a micrograin distribution is that it decouples structural from reflectance parameters. As a result, our model is analytic for a range of micrograin reflectances (diffuse, diffuse + specular and conductor). Morover, all material parameters are easily assigned to material texture maps, which eases the adoption of our model in existing asset creation workflows (see Figure 1). Finally, our approach works directly with multi-scale rendering techniques relying on mipmapping. We demonstrate these features and compare to related work in Section 6.

## 2 PREVIOUS WORK

Material appearance has been the focus of many computer graphics works in the last two decades. Numerous models have been proposed in order to best represent the wide variety of real-world materials. Microfacet models [Cook and Torrance 1982; Torrance and Sparrow 1967; Walter et al. 2007] are nowadays very famous in graphics production to simulate specular to rough materials. The theory relies on the statistical organization of microfacets, driven by their Normal Distribution Function and associated to a visibility term that accounts for self-occlusion (masking and shadowing). The latter may be based on v-groove profiles [Torrance and Sparrow 1967] or Smith's representation [Ashikhmin et al. 2000; Smith 1967] for more physically-plausible results. Their elementary reflectance can be perfectly specular (through a Fresnel term in many cases) [Cook and Torrance 1982] or Lambertian [Oren and Nayar 1994]. The initial microfacet models are limited to single scattering but have been recently completed with multiple scattering effects either with numerical stochastic simulations for Smith [Bitterli and d'Eon 2022; Heitz et al. 2016] or analytic models for v-grooves [Lee et al. 2018; Xie and Hanrahan 2018]. Note that for now, multiple scattering is not considered in our porous layer and we leave this question to future work.

On top of microfacet models, many extensions have been proposed to extend the range of appearances they can represent such as back-scattering properties visible in cloth-like materials (e.g. sheen BSDF [Estevez and Kulla 2017; Zeltner et al. 2022]). In this paper, we focus on porous materials, which also exhibit back-scattering effects. Merillou et al. [Merillou et al. 2000] were the first to propose an empiric modification to add porosity on already-defined BSDF models. They consider cylindrical pores by adding a diffuse lobe corresponding to multiples reflection in pores. In contrast, our approach is built upon physically-based considerations. Compared to other representations based on microfacets or microflakes (e.g., [Barla et al. 2018; d'Eon et al. 2023; Dupuy et al. 2016; Wang et al. 2022]), it explicitly models a distribution of micrograins, which has the effect of decoupling structural and reflectance properties. This has a number of advantages, as we will show in the following.

## 3 OVERVIEW

We assume that a porous material is made of a mono-disperse distribution of microscopic spherical grains of radius $r_s$ which, depending on their density $\rho$, may interpenetrate to form aggregates and/or leave gaps that open pores in the material. As shown in Figure 2,

<figure><img src="image_3.png" /><figcaption>Fig. 2. A porous layer is modelled as a distribution of opaque half-ellipsoids (micrograins in blue) on an arbitrary bulk material (hatched region).</figcaption></figure>

the micrograins are distributed on a bulk material, with their upper parts sticking out of the surface and vertically compressed by an anfractuosity parameter $\beta \in [0, 1]$, yielding half-ellipsoids. The micrograins are considered opaque, and optical interactions with them are governed by their micro-BRDF, which may be of three types: diffuse (Lambertian), diffuse + specular dielectric, and specular conductor. As classically done in microfacet models, micro-BRDFs may be colored either through the diffuse albedo or the specular conductor reflectance.

Our goal is to characterize the BRDF resulting from the combination of the porous layer and the bulk surface, which we write:

$$f_r(\mathbf{i}, \mathbf{o}) = w^+(\mathbf{i}, \mathbf{o})f_r^S(\mathbf{i}, \mathbf{o}) + (1 - w^+(\mathbf{i}, \mathbf{o}))f_r^B(\mathbf{i}, \mathbf{o}), \quad (1)$$

where $f_r^S$ and $f_r^B$ are surfacic (porous) and bulk BRDF components respectively, and $w^+$ denotes the proportion of light paths starting from the ingoing direction i and ending with the outgoing direction o, that interact only with the micrograins distributed on the surface.

We model the surfacic BRDF component $f_r^S$ as the sum of a diffuse Lambertian term and a microfacet-based specular component:

$$f_r^S(\mathbf{i}, \mathbf{o}) = \frac{K_d}{\pi} \bar{T}(\mathbf{i}, \mathbf{o}) + \frac{D(\mathbf{h})G(\mathbf{i}, \mathbf{o})F(\mathbf{i} \cdot \mathbf{h})}{4|\mathbf{i} \cdot \mathbf{n}| |\mathbf{o} \cdot \mathbf{n}|}, \quad (2)$$

with $\mathbf{n}$ and $\mathbf{h} = \frac{i+\mathbf{o}}{\|i+\mathbf{o}\|}$ the geometric normal and the halfway vector respectively, $K_d$ the diffuse albedo of grains, $\bar{T}$ an integrated transmittance used for energy conservation<fnref n="1" />, $D$ the normal distribution function (NDF) of grain aggregates with $G$ the corresponding geometric attenuation factor (GAF), and $F$ the Fresnel reflectance.

In the following, we first derive the NDF $D$ in Section 4. We then compute in Section 5 a visibility term that is both used in the definition of the weight $w^+$ and of the GAF $G$. A summary of the main notations used in the paper is given in Table 1. The BRDF model defined through Equations 1 and 2 is reciprocal provided $w^+$ is itself reciprocal, which is indeed the case (see Equation 24).

## 4 NORMAL DISTRIBUTION FUNCTION

Intuitively, the NDF $D$ may be determined in two steps: for a given point $\mathbf{x}$ on the surface, we first need to find the closest grain (see Figure 3); if this grain is at a distance smaller than the grain radius $r_s$, then we might project $\mathbf{x}$ onto the (spherical or elliptic) grain surface to retrieve a microfacet normal $\mathbf{m}$ (Figure 3).

We describe the distribution of closest grains in Section 4.1, from which we derive the corresponding NDF in Section 4.2.

### 4.1 Distribution of closest grains

We assume that grains are uniformly distributed on the surface. Since they are ellipsoids, their intersection with the surface forms

<footnote n="1">¹We use an approach inspired by Mitsuba [Jakob et al. 2022] as detailed in supplemental material</footnote>
<table><caption>Table 1. Summary of main notations</caption><tr><td><b>x</b></td><td>Geometric surface point</td></tr><tr><td><b>m</b></td><td>Micrograin surface normal</td></tr><tr><td><i>X</i>(<b>m</b>)</td><td>Mapping from micrograin to geometric surface</td></tr><tr><td><i>ρ</i></td><td>Micrograin distribution density</td></tr><tr><td><i>r</i><sub>s</sub></td><td>Micrograin radius</td></tr><tr><td><i>β</i></td><td>Micrograin anfractuosity</td></tr><tr><td><b>p</b><sup>(1)</sup></td><td>Distribution of distances to the closest grain</td></tr><tr><td><b>P</b><sup>(1)</sup></td><td>Cumulative distribution of distances to the closest grain</td></tr><tr><td><i>D</i>(<b>m</b>)</td><td>Micrograin normal distribution function</td></tr><tr><td><i>τ</i><sub>0</sub></td><td>Filling factor at normal incidence</td></tr><tr><td><i>τ</i><sub>β</sub><sup>+</sup>(<i>θ</i>)</td><td>Visible filling factor at incidence <i>θ</i></td></tr><tr><td><i>w</i><sup>+</sup>(<i>θ</i><sub>i</sub>, <i>θ</i><sub>o</sub>)</td><td>Weight of the micrograin layer</td></tr></table>

discs. We thus consider here the distribution of *n* discs of center *c*<sub>*i*</sub> (*i* ≤ *i* ≤ *n*) in the 2D plane. For a given 2D point **x**, the distance to the center of the closest disc is written as:

$$d^*(\mathbf{x}) = \min_i \|\mathbf{x} - c_i\| = \|\mathbf{x} - c^*\| \quad (3)$$

where $c^*$ is the disc center that is closest to **x**.

We want to determine the probability density function $p(d^*(\mathbf{x}) = r)$ that gives the likelihood of $c^*$ to be at a distance $r$ of **x**. This corresponds to the first order statistic (cf. [David and Nagaraja 2004]), which we write $p^{(1)}(r) := p(d^*(\mathbf{x}) = r)$ in the following.

<figure><img src="image_4.png" /><figcaption>Fig. 3. Left: A distribution of discs of radius $r_s$ in a region of radius $R$ centered on the point of interest **x**, with the closest disc centered at $c^*$. Right: A point on the surface of an elliptic micrograin can be identified by its normal **m** and mapped to a point **x** = $\mathcal{X}(\mathbf{m})$ of the plane that lies at a distance $r \le r_s$ to the micrograin center $c^*$.</figcaption></figure>

We first consider the case where the number *n* of grains is finite, for which we want to compute the finite first-order statistic $p_n^{(1)}(r)$. In a circular region of radius *R* and center **x**, there are *n* = $\pi R^2 \rho$ discs, with $\rho$ the grain density (see Figure 3). The proportion of discs whose centers are at a distance *d*(**x**) smaller than *r* is given by:

$$P_n(r) := p_n(d(\mathbf{x}) \le r) = \frac{\pi r^2 \rho}{\pi R^2 \rho} = \frac{r^2}{R^2}, \quad (4)$$

which is a cumulative distribution function (CDF). The proportion of discs whose centers are *at a distance r* then corresponds to the following probability distribution function (PDF):

$$p_n(r) := p_n(d(\mathbf{x}) = r) = \frac{\partial p_n}{\partial r}(r) = \frac{2r}{R^2}. \quad (5)$$

The finite first-order statistic is given by (see Supplemental Material for mathematical details):

$$p_n^{(1)}(r) = np_n(r) [1 - P_n(r)]^{n-1}. \quad (6)$$

Using Equations 4 and 5 along with $R^2 = \frac{n}{\pi \rho}$, we obtain:

$$p_n^{(1)}(r) = 2\pi\rho r \left(1 - \frac{\pi\rho r^2}{n}\right)^{n-1}. \quad (7)$$

The first-order statistic $p^{(1)}(r)$ for an infinite surface is then obtained by taking the limit of Equation 7 when *R* tends toward infinity, or equivalently when *n* tends toward infinity:

$$p^{(1)}(r) = \lim_{n \to \infty} p_n^{(1)}(r) = 2\pi\rho r e^{-\pi\rho r^2}. \quad (8)$$

The associated CDF $P^{(1)}(r)$ is obtained by integration:

$$P^{(1)}(r) = \int_{0}^{r} p^{(1)}(r') dr' = 1 - e^{-\pi \rho r^2}. \quad (9)$$

Lastly, the probability that the center of the closest disc is at polar coordinates $(r, \phi)$ is computed using the following PDF:

$$p^{(1)}(r, \phi) = p^{(1)}(r)p(\phi) = \rho e^{-\pi \rho r^2}, \quad (10)$$

where we have used a uniform angular distribution $p(\phi) = \frac{1}{2\pi r}$.

In Figure 4(a), we show the distribution of distances to the closest disc $p^{(1)}(r)$ for several densities of micrograins, and compare our analytic formula to numerical simulations.

<figure><img src="image_5.png" /><figcaption>Fig. 4. (a) Comparison of the distribution of distances to the closest disc center $p^{(1)}(r)$ (solid lines) to numerical simulations (dots) showing excellent agreement. The ground truth is obtained by sampling *n* random disc centers over a $10000^2$ unit square area and by computing the histogram of distances to the closest center. (b) The corresponding CDF (blue area) evaluated at a distance $r = r_s$ yields the filling factor $\tau_0$.</figcaption></figure>

## 4.2 Distribution of normals

Let us now assume that there is at least one disc whose center is at distance to **x** that is smaller than $r_s$, the grain radius (i.e., $r \le r_s$). Such a constraint is met by construction if we use a function $\mathcal{X}: \Omega \to \mathbb{R}^2$ that projects a point on the closest grain onto the surface, which maps a normal **m** = ($\theta_m, \phi_m$) on the grain surface to a 2D point of the plane **x** = ($r, \phi$) (see Figure 3):

$$p^{(1)}((r, \phi) \cap r < r_s) = p^{(1)}(\mathcal{X}(\mathbf{m})). \quad (11)$$

The likelihood that the point on the closest grain has a normal **m** is then given by $p^{(1)}(\mathbf{m}) = p^{(1)}((r, \phi) | r < r_s)$. Using Bayes'
<figure><img src="image_6.png" /><figcaption>Fig. 5. Illustration of our micrograin NDF D for several values of β and τ₀. Increasing τ₀ for a fixed β yields a sharper distribution. Numerical simulations are shown with dots.</figcaption></figure>

theorem then Equation 11, we have:

$$p^{(1)}(\mathbf{m}) = \frac{p^{(1)}((r, \phi) \cap r < r_s)}{p^{(1)}(r < r_s)} = \frac{p^{(1)}(\mathcal{X}(\mathbf{m}))}{p^{(1)}(r_s)}. \quad (12)$$

The denominator in Equation 12 corresponds to the surfacic filling factor (see Equation 9), as illustrated in Figure 4(b):

$$\tau_0 = P^{(1)}(r_s) = 1 - e^{-\pi \rho r_s^2}. \quad (13)$$

We explain in details in Supplemental Material how to derive the NDF $D(\mathbf{m})$ from $p^{(1)}(\mathbf{m})$. We start by normalizing $p^{(1)}(r)$ for $r \in [0, r_s]$, which after several simplifications yields:

$$\int_{\Omega} p^{(1)}(\mathbf{m})r(\theta_m) \frac{J_r(\theta_m)}{\sin \theta_m} d\omega_m = 1, \quad (14)$$

where we have used $\mathcal{X}(\mathbf{m}) = (r(\theta_m), \phi_m)$ since grains are radially symmetric, and where $J_r(\theta_m)$ is a Jacobian associated to $r(\theta_m)$. Then, by analogy with the normalization constraint of NDFs (i.e., $\int_{\Omega} D(\mathbf{m}) \cos \theta_m d\omega_m = 1$), we obtain:

$$D(\mathbf{m}) = \frac{p^{(1)}(\mathbf{m})r(\theta_m)J_r(\theta_m)}{\sin \theta_m \cos \theta_m}. \quad (15)$$

Lastly, after deriving expressions for $p^{(1)}(\mathbf{m})$, $r(\theta_m)$ and $J_r(\theta_m)$ in the case of an ellipsoid, we obtain:

$$D(\mathbf{m}) = \frac{\beta^2 \rho r_s^2 e^{-\pi \rho r_s^2 \frac{\tan^2 \theta_m}{\beta^2 + \tan^2 \theta_m}}}{(1 - e^{-\pi \rho r_s^2})(\beta^2 + \tan^2 \theta_m)^2 \cos^4 \theta_m}, \quad (16)$$

where $\beta \in [0, 1]$ controls the anfractuosity of grains on the surface.

Using the surfacic filling factor $\tau_0$, we may rewrite the NDF as a variant of the GGX NDF:

$$D(\mathbf{m}) = -\frac{\ln(1 - \tau_0)(1 - \tau_0) \frac{\tan^2 \theta_m}{\beta^2 + \tan^2 \theta_m}}{\tau_0} D^{\text{GGX}}(\mathbf{m}), \quad (17)$$

where $\beta$ is used to control roughness in $D^{\text{GGX}}$. When $\tau_0$ tends toward 0, the prefactor in Equation 17 tends toward 1 and $D$ tends toward $D^{\text{GGX}}$. Intuitively, the lower $\tau_0$, the more grains get isolated from each other, making $D$ tend toward the NDF of individual ellipsoids. Hence for $\tau_0 = 0$, $\beta$ is identical to the GGX roughness parameter $\alpha$.

Figure 5 shows our NDF for several values of anfractuosity $\beta$ and filling factor $\tau_0$, along with comparisons with numerical simulations. Increasing the filling factor $\tau_0$ increases the inter-penetration of micrograins, in effect decreasing the roughness of the porous layer for a constant $\beta$. This might be undesired for artistic control. Therefore,

we introduce an equivalent roughness parameter $\tilde{\alpha}$ that is linearly related to $\beta$ by imposing that $D^{\text{GGX}} = D$ for $\theta_m = 0$, yielding:

$$\begin{aligned} \frac{\tilde{\alpha}^2}{\pi \tilde{\alpha}^4} &= \frac{\ln(1 - \tau_0)\beta^2}{\tau_0 \pi \beta^4}, \\ \tilde{\alpha} &= \beta \sqrt{-\frac{\tau_0}{\ln(1 - \tau_0)}}. \end{aligned} \quad (18)$$

The maximum achievable equivalent roughness $\tilde{\alpha}_{\text{max}}$ thus depends on $\tau_0$ and is obtained when $\beta = 1$ in Equation 18, as shown in Supplemental Material. In practice, we limit $\tau_0$ to 0.98 to ensure that $\tilde{\alpha}_{\text{max}} > 0.5$, granting sufficient artistic control.

### 4.3 Importance Sampling

We follow the microfacet framework described in Walter et al. [Walter et al. 2007] for importance sampling the specular component of Equation 2. Apart from the sampling of the NDF, the rest of the sampling procedure, including sample weights formula, remain unchanged.

As detailed in Supplemental Material, the CDF corresponding to the PDF $D(\theta_m)$ cos $\theta_m$ is given by:

$$C(\theta_m) = \frac{1 - e^{-\pi \rho r_s^2 \frac{\tan^2 \theta_m}{\beta^2 + \tan^2 \theta_m}}}{1 - e^{-\pi \rho r_s^2}} = \frac{P^{(1)}(r_s(\theta_m))}{\tau_0}, \quad (19)$$

while the corresponding inverse CDF is given by:

$$C^{-1}(\xi) = \arctan \left( \beta \sqrt{\frac{\ln(1 - \xi \tau_0)}{\ln(1 - \xi \tau_0) - \ln(1 - \tau_0)}} \right). \quad (20)$$

Therefore, $(\theta_m, \phi_m) = (C^{-1}(\xi_1), 2\pi\xi_2)$ where $\xi_1$ and $\xi_2$ are uniformly-distributed random variables.

## 5 VISIBILITY TERMS

In this section, we derive visibility terms of both the distribution of micrograins as a whole, and of the corresponding microfacets.

### 5.1 Visible Filling factor

<figure><img src="image_7.png" /><figcaption>Fig. 6. The distribution of spherical micrograins seen from an angle $\theta$ is obtained by a mere projection of the original distribution of micrograins. This has the effect of increasing the effective density.</figcaption></figure>

The surfacic filling factor $\tau_0$ corresponds to the proportion of grains on the surface visible at normal incidence. We also want to characterize the visible filling factor $\tau_\beta(\theta)$ from a direction of elevation $\theta$, which differs from $\tau_0$ since grains then tend to mask each others in a way that depends on the anfractuosity $\beta$.
When $\beta = 1$, the spherical grains may be projected onto the plane orthogonal to the direction of interest (see Figure 6). This gives rise to a new distribution of discs with the same radius $r_s$, but a higher density, yielding $\tau_1(\theta) = 1 - e^{-\pi r_s^2 \frac{\rho}{\cos \theta}}$.

<figure><img src="image_8.png" /><figcaption>Fig. 7. (a) At normal incidence, the filling factor $\tau_0$ gives the proportion of grains on the surface. (b) At a different angle, the visible filling factor increases and is affected by the anfractuosity (here $\beta = 0.8$). Only the upper halves of ellipsoids (in blue) must be considered.</figcaption></figure>

In the general case ($\beta \in [0, 1]$), we need to consider the projection of ellipsoids, which gives rise to a distribution of ellipses in the projection plane (see Figure 7). If we write $\gamma_\beta(\theta)$ the compression factor of these ellipses, we can find an equivalent distribution of discs using a modified density, as in the following:

$$ \tau_{\beta}(\theta) = 1 - e^{-\pi r_s^2 \rho \frac{\gamma_{\beta}(\theta)}{\cos \theta}} = 1 - (1 - \tau_0) \frac{\gamma_{\beta}(\theta)}{\cos \theta}. \quad (21) $$

To compute $\gamma_\beta(\theta)$, we assume without loss of generality that $r_s = 1$. In the incidence plane (see Figure 8), the slice of an ellipsoid then yields an ellipse of radii 1 and $\beta$ in horizontal and vertical directions respectively. The equation of the two lines of slope $\frac{\cos \theta}{\sin \theta}$ (our direction of interest) and tangent to such an ellipse is given by:

$$ \cos \theta x - \sin \theta y \pm \sqrt{\cos^2 \theta + \beta^2 \sin^2 \theta} = 0. $$

The compression factor $\gamma_\beta(\theta) = \sqrt{\cos^2 \theta + \beta^2 \sin^2 \theta}$ then corresponds to the distance of either of these lines to the origin. When $\beta = 0$ (flattened grains), we have $\tau_0(\theta) = \tau_0$ for all $\theta$. Moreover, at normal incidence, we retrieve $\tau_\beta(0) = \tau_0$ regardless of $\beta$.

<figure><img src="image_9.png" /><figcaption>Fig. 8. A micrograin seen from a direction of elevation $\theta$ (in green) shows as an ellipse compressed by a factor $\gamma_\beta$ in the vertical direction. It corresponds to the distance of tangent lines of elevation $\theta$ (in black) to the origin.</figcaption></figure>

Only the upper part of grains should contribute to the surfacic BRDF component. The corresponding visible surfacic filling factor

$\tau_\beta^+(\theta)$ is given by a formula similar to that of Equation 21, the only difference being that $\gamma_\beta(\theta)$ is replaced by $\gamma_\beta^+(\theta) = \frac{1}{2}(\gamma_\beta(\theta) + \cos \theta)$. Indeed, as already observed by Heitz [Heitz 2018] and shown in Figure 7(b), the projection of the upper parts of ellipsoids corresponds to the junction of two half ellipses: one being the projection of the ellipsoid of anfractuosity $\beta$, the other being the projection of a disc (i.e., $\beta = 0$). After some simplifications, this yields:

$$ \tau_{\beta}^{+}(\theta) = 1 - \sqrt{\left(1 - \tau_{\beta}(\theta)\right)\left(1 - \tau_{0}\right)}. \quad (22) $$

Figure 9 shows the visible filling factor function $\tau_\beta^+(\theta)$ for various configurations of filling factors $\tau_0$ and anfractuosity $\beta$, along with comparisons to numerical simulations.

<figure><img src="image_10.png" /><figcaption>Fig. 9. The visible filling factor $\tau_\beta^+$ is shown for three values of $\tau_0$ and $\beta$. As expected, all curves start at $\tau_0$ for $\theta = 0$ and end up at 1 for $\theta = \frac{\pi}{2}$. Comparisons with numerical simulations (dots) show excellent agreement.</figcaption></figure>

The weight factor $w^+$ of Equation 1 is then obtained by considering that the set of light paths that interact with the surface is the complement of those that reach the pores from both i and o. The probability of being in a pore is $1 - \tau_0$, and the visibility probability of a point x knowing that x is in a pore is given by $\frac{1 - \tau_\beta^+(\theta)}{1 - \tau_0}$, yielding:

$$ w^{+}(\mathbf{i}, \mathbf{o}) = 1 - \frac{(1 - \tau_{\beta}^{+}(\theta_{i}))(1 - \tau_{\beta}^{+}(\theta_{o}))}{1 - \tau_{0}}. \quad (23) $$

Using Equation 22, this simplifies to:

$$ w^{+}(\mathbf{i}, \mathbf{o}) = 1 - \sqrt{(1 - \tau_{\beta}(\theta_{i}))(1 - \tau_{\beta}(\theta_{o}))}. \quad (24) $$

Note that we assume that there is no correlation between i and o; hence we consider the validation of $w^+$ to follow from that of $\tau_\beta^+$.

## 5.2 Geometric term

We are now left with the derivation of the geometric term G, which may be computed (cf. [Heitz 2014]) from $G_1(\theta) = \frac{1}{1+\Lambda(\theta)}$.

The computation of $\Lambda(\theta)$ for our distribution is more complex than for a GGX distribution. As detailed in Supplemental material, the exact analytic formula is given by an infinite series of the form:

$$ \Lambda(\theta) = \frac{\pi \rho r_s^2}{2(e^{\pi \rho r_s^2} - 1) \cot \theta} \sum_{n=0}^{+\infty} (\pi \rho r_s^2)^n F_n(\beta, \cot \theta). \quad (25) $$

In practice, the five first terms of the series (i.e., $n = 4$) give a very close approximation. An alternative consists in using the $\Lambda(\theta)$ term associated with the GGX distribution, using the equivalent
roughness of Equation 18. We compare both solutions to a reference obtained with $n = 20$ in Figure 10 for two configurations of parameters. More comparisons are shown in supplemental material.

<figure><img src="image_11.png" /><figcaption>Fig. 10. The $G_1$ term of the GAF for our NDF is shown in the critical configuration where $\tau_0 = 0.98$ for two values of $\beta$. Using the GGX $G_1$ term yields a conservative approximation, which is often sufficient for lower $\tau_0$ values.</figcaption></figure>

## 6 RESULTS

*Relationship to previous work.* We start by comparing our method to other microfacet-based models showcasing grazing-angle effects. Among existing work, the two closest models are the one of Merillou et al. [Merillou et al. 2000] and d'Eon et al. [d'Eon et al. 2023]. The three models (including ours) make different hypothesis concerning the modeled microstructure. Yet they all boil down to a combination of a pair of BRDF components based on an angular-dependent weight function (in our case, $w^+$). In the case of the model d'Eon et al., we can match its two parameters to the parameters of our model by imposing that their weight function and ours be equal when $\theta_i = 0$, yielding:

$$ (1 - w_A) \frac{1}{G_{\tilde{\alpha}}(0, \theta_o)} = 1 - w^+(0, \theta_o) = 1 - \tau_{\beta}^+(\theta_o), \quad (26) $$

where $w_A$ denotes the parameter in the model of d'Eon et al. and $G_{\tilde{\alpha}}$ is the GGX GAF where we set roughness from $\beta$ using Equation 18. However, note that there is no simple bijection between the two models, since Equation 26 still depends on $\theta_o$. If we further enforce $\theta_o = 0$ in Equation 26, we then get $w_A = \tau_0$. As shown in Figure 11 for two values of $\theta_o$, the two weighting functions exhibit a similar profile. In contrast, the model of Merillou cannot be remapped in the same vein. We can still plot it in Figure 11 since one of its parameters is the porosity $1 - \tau_0$, showing a more different profile than the other two weighting functions.

In Figure 12(a), we compare our model to the one of d'Eon et al. [d'Eon et al. 2023] on renderings, using $w_A = \tau_0$ and $\alpha = \tilde{\alpha}$. The differences between the two models are subtle, and mainly show up for large values of $\tau_0$ and small values of $\tilde{\alpha}$. They are not only due to the different weighting functions, but also to the slightly different shape of our NDF. We also provide a comparison to the model of Walter et al. [Walter et al. 2007] (which does not vary with $\tau_0$) for reference in Figure 12(b).

When using our GAF formulation with $n = 4$ as suggested in Supplemental Material, our model shows a 20% overhead compared to the (single-scattering) model of d'Eon et al. [d'Eon et al. 2023] or Walter et al. [Walter et al. 2007]. This overhead vanishes when we use the approximate GGX GAF.

<figure><img src="image_12.png" /><figcaption>Fig. 11. The weight mixture functions of three models are compared: Merillou [Merillou et al. 2000] (dotted), d'Eon [d'Eon et al. 2023] (dashed) and ours (solid). The anfractuosity is set to $\beta = 0.5$, from which an equivalent roughness parameter $\tilde{\alpha}$ is computed for the first two models. Even though the three models may be made equal at $\theta_i = \theta_o = 0$ as shown at left, they differ at other angular configurations. As shown at right, our model is closest to the one of d'Eon.</figcaption></figure>

*Parameter variations.* Next, we demonstrate different homogeneous material configurations in simple scene settings, all rendered within Mitsuba 3 [Jakob et al. 2022]. Figure 13 shows a selection taken from our Supplemental material, where we render spheres by combining all types of micrograins (diffuse, diffuse+specular and metallic) on various types of bulk materials. This reveals an advantage of our approach compared to previous work such as the method of d'Eon et al. [d'Eon et al. 2023]: we can achieve a wider range of appearance with our analytical model, since the mixing of porous layers on bulk surfaces is decoupled from micrograin reflectance. Even though the diffuse component of our model is a mere Lambertian term, it already allows for the rendering of diffuse or diffuse+specular micrograins in an analytical fashion, which does not seem to be achievable in the model of d'Eon et al. In supplemental material, we evaluate the Lambertian approximation using Monte-Carlo reference simulations, and show that a better approximation can be achieved by using the stochastic model of Heitz and Dupuy [Heitz and Dupuy 2015].

In Figure 13, we pick an anfractuosity $\beta$ per type of micrograin and show renderings for an intermediate filling factor $\tau_0 = 0.5$. We observe a variety of interesting effects: hazy reflections, changes of color at grazing angles or in front-facing configurations, reduced reflections or refractions even at grazing-angles (as opposed to non-porous materials), dirty-looking surfaces.

*Surface-varying materials.* Figure 1 showcases several material configurations where we have used textures to control the filling factor parameter $\tau_0$ in our model. Note that the $w_A$ parameter of the method of d'Eon et al. [d'Eon et al. 2023] could be used in the same way, even though the physical interpretation would then differ from our model. The filling factor may even be correlated to height or roughness textures, easing the adoption of our model in asset creation pipelines.

*Multi-scale rendering.* Since the filling factor characterizes the relative area of grains on the surface, variations of $\tau_0$ may be averaged in surface regions of increasing areas to yield multi-scale filling factors. We provide proofs of concept of the multi-scale rendering abilities of our model through three ShaderToy programs
(in GLSL) that we provide in Supplemental Material. We only use
point or directional lights, and rely on mipmapped textures for
multi-scale effects. Screenshots of the three corresponding scenes
are shown in Figure 14. In the Mossy stones scene, we correlate
$\tau_0$ with a height map that is also used for bump mapping, using
diffuse micrograins of constant greenish reflectance. In the Dusty
wood scene, variations of $\tau_0$ are independent of the bulk surface and
vary at two different scales, using diffuse micrograins with slight
color reflectance variations. The Graffiti scene showcases metallic
micrograins mimicking a metallic paint on a rougher metallic sur-
face, with different paint thicknesses reproduced via the $\tau_0$ texture,
yielding different appearance under different light directions.

# 7 DISCUSSION

We have introduced a physically-based method for the rendering
of porous layers on arbitrary surfaces. It is based on a distribution
of opaque micrograins, from which we derive the classical NDF
and GAF of microfacet theory, as well as a weight mixture function
for combination with a bulk material. The advantage of working
with micrograins is that their structural properties (filling factor and
anfractuosity) are decoupled from their reflectance properties. As a
result, our model permits the production of a wide range of effects, it
is easily controlled by classical material textures, and readily works
in multi-scale rendering frameworks.

*Limitations.* A current limitation of our model is that it does not handle multiple scattering among micrograins. To this end, recent solutions [Bitterli and d'Eon 2022; Heitz et al. 2016] could be followed, but they require the definition of the visible NDF, which we have not yet derived in our case. Another limitation is anisotropy. Even though we believe anisotropic grains are not common, they could consitute an interesting artistic feature. The work of Atanasov et al. [Atanasov et al. 2022] could provide a relevant approach to extend our model to anisotropy. Note that both multiple scattering and anisotropy are possible in the recent model of d'Eon et al. [d'Eon et al. 2023]. We find the similarity between this model and ours – in spite of different structural hypotheses – to be interesting, even though more differences might emerge in future developments. In particular, we could use height-normals correlations implied by micrograins to compute a more accurate GAF. We provide additional comparisons to Monte-Carlo reference simulations on explicit micrograin distributions in supplemental material to show the remaining margin of progress that can be expected from such an improved GAF. Finally, grazing-angle effects created with our approach emerge from the distribution or micrograins. For a more direct (yet less physically-plausible) control over grazing-angle effects, sheen models [Estevez and Kulla 2017; Zeltner et al. 2022] might be better adapted.

*Future work.* A main assumption of our model is that micrograins are opaque. A challenging direction of future work would be to extend our model to transparent micrograins, which will require suitable approximations to the potentially complex light paths occurring in an half-ellipse. We would also like to investigate poly-disperse distributions of micrograins, with variations in either their radii or even their shapes, and distributions of reflectance properties. An

exciting research direction would be to combine our porous layer
model with existing volumetric BRDF models (e.g., [d'Eon 2021;
Hapke 2012]), which assume that the bulk material is also composed
of a distribution of spherical micrograins. This will not only require
identifying correspondences between our model parameters and
volumetric material parameters (i.e., single scattering albedo, phase
function assymetry, volumetric filling factor); but it will also be
necessary to model interactions between surfacic and volumetric
components.

# ACKNOWLEDGMENTS

We would like to thank the reviewers for helping us improve the
paper. This work has been funded by the Inria Exploratory Action
Ecoptics.

# REFERENCES

M. Ashikhmin, S. Premoze, and P. Shirley. 2000. A microfacet-based BRDF generator. In *Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 2000*, New Orleans, LA, USA, July 23-28, 2000. ACM, 65–74.

A. Atanasov, V. Koylazov, R. Dimov, and A. Wilkie. 2022. Microsurface Transformations. *Computer Graphics Forum* 41, 4 (2022), 105–116. https://doi.org/10.1111/cgf.14590 arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.14590

P. Barla, R. Pacanowski, and P. Vangorp. 2018. A Composite BRDF Model for Hazy Gloss. *Computer Graphics Forum* 37, 4 (2018), 55–66. https://doi.org/10.1111/cgf.13475 arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.13475

Benedikt Bitterli and Eugene d'Eon. 2022. A Position-Free Path Integral for Homogeneous Slabs and Multiple Scattering on Smith Microfacets. *Computer Graphics Forum* 41, 4 (2022), 93–104. https://doi.org/10.1111/cgf.14589 arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.14589

R. L. Cook and K. E. Torrance. 1982. A Reflectance Model for Computer Graphics. In *ACM SIGGRAPH proceedings*.

Herbert A David and Haikady N Nagaraja. 2004. *Order statistics*. John Wiley & Sons.

Eugene d'Eon. 2021. An analytic BRDF for materials with spherical Lambertian scatterers. *Computer Graphics Forum* 40, 4 (2021), 153–161. https://doi.org/10.1111/cgf.14348 arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.14348

Eugene d'Eon, Benedikt Bitterli, Andrea Weidlich, and Tizian Zeltner. 2023. Microfacet theory for non-uniform heightfields. In *SIGGRAPH 2023 Conference Papers* (Los Angeles, CA, USA). Association for Computing Machinery, New York, NY, USA, 10 pages. https://doi.org/10.1145/3588432.3591486

Jonathan Dupuy, Eric Heitz, and Eugene d'Eon. 2016. Additional Progress towards the Unification of Microfacet and Microflake Theories. In *Proceedings of the Eurographics Symposium on Rendering: Experimental Ideas & Implementations* (Dublin, Ireland) (EGSR '16). Eurographics Association, Goslar, DEU, 55–63.

Alejandro Conty Estevez and Christopher Kulla. 2017. Production Friendly Microfacet Sheen BRDF. *ACM SIGGRAPH 2017* (2017).

Bruce Hapke. 2012. *Theory of Reflectance and Emittance Spectroscopy* (2 ed.). Cambridge University Press. https://doi.org/10.1017/CBO9781139025683

E. Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. *Journal of Computer Graphics Techniques* 3, 2 (June 2014).

Eric Heitz. 2018. Sampling the GGX Distribution of Visible Normals. *Journal of Computer Graphics Techniques (JCGT)* 7, 4 (30 November 2018), 1–13. http://jcgt.org/published/0007/04/01/

Eric Heitz and Jonathan Dupuy. 2015. *Implementing a Simple Anisotropic Rough Diffuse Material with Stochastic Evaluation*. Technical Report.

Eric Heitz, Johannes Hanika, Eugene d'Eon, and Carsten Dachsbacher. 2016. Multiple-Scattering Microfacet BSDFs with the Smith Model. *ACM Trans. Graph.* 35, 4, Article 58 (Jul 2016), 14 pages. https://doi.org/10.1145/2897824.2925943

Wenzel Jakob, Sébastien Speierer, Nicolas Roussel, Merlin Nimier-David, Delio Vicini, Tizian Zeltner, Baptiste Nicolet, Miguel Crespo, Vincent Leroy, and Ziyi Zhang. 2022. *Mitsuba 3 renderer*. https://mitsuba-renderer.org.

Joo Ho Lee, Adrian Jarabo, Daniel S. Jeon, Diego Gutierrez, and Min H. Kim. 2018. Practical Multiple Scattering for Rough Surfaces. *ACM Trans. Graph.* 37, 6, Article 275 (Dec 2018), 12 pages. https://doi.org/10.1145/3272127.3275016

S. Merillou, J.-M. Dischler, and D. Ghazanfarpour. 2000. A BRDF postprocess to integrate porosity on rendered surfaces. *IEEE Transactions on Visualization and Computer Graphics* 6, 4 (2000), 306–318. https://doi.org/10.1109/2945.895876

Thomas Müller, Marios Papas, Markus Gross, Wojciech Jarosz, and Jan Novák. 2016. Efficient Rendering of Heterogeneous Polydisperse Granular Media. *ACM Transactions on Graphics (Proceedings of SIGGRAPH Asia)* 35, 6 (Dec. 2016), 168:1–168:14. https://doi.org/10/f9cm65
<figure><img src="image_13.png" /><figcaption>Fig. 12. Compared to (a) the model of d'Eon et al. [d'Eon et al. 2023] (bottom halves), our model produces very similar rendering results (top halves), here using a directional light. Slight differences may be observed only for high values of $τ_0$ and low values of $\tilde{\alpha}$. In contrast, our model has several advantages, see text. Comparisons to (b) the model of Walter et al. [Walter et al. 2007] (bottom halves) show the impact of the filling factor $τ_0$.</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>Fig. 13. Different combinations of porous layers (rows) on bulk materials (columns). We use $τ_0$ = 0.5 throughout but pick different $β$ values for each type of porous layer. The top row (resp. first column) shows the bulk material (resp. porous layer) in isolation. A variety of interesting visual effects (indicated by small symbols) are noteworthy: hazy reflections due to the porous layer ▲ or to the bulk surface ▲; grazing-angle color changes ♦ and front-facing color changes ♦; dirty surfaces with reduced specular reflection ■; reduced bulk transparency ★.</figcaption></figure>
<figure><img src="image_15.png" /><figcaption>Fig. 14. Screenshots taken from our SHaderToy programs and demonstrating our model on three scenes. In the Mossy stones scene (left), we add a greenish diffuse porous layer correlated to stone heights. We compare a linear mixing based on $τ_0$ with our view- and light-dependent mixing $w^+$. Observe how the linear mixing fails to capture greenish grazing-angle effects. In the Dusty wood scene (top right), we modulate $τ_0$ with noise functions at two different scales. Observe how the grayish gradient toward the horizon is preserved at all three scales. The Graffiti scene (bottom right) uses metallic micrograins and several levels of $τ_0$ to mimick different layers of metallic paint, which drastically change in appearance when the light direction is modified.</figcaption></figure>

M. Oren and S. K. Nayar. 1994. Generalization of Lambert's Reflectance Model. In *ACM SIGGRAPH proceedings*.

B. Smith. 1967. Geometrical shadowing of a random rough surface. *IEEE Transactions on Antennas and Propagation* 15, 5 (September 1967), 668–671.

K. E. Torrance and E. M. Sparrow. 1967. Theory for Off-Specular Reflection From Roughened Surfaces*. *J. Opt. Soc. Am.* 57, 9 (Sep 1967), 1105–1114. https://doi.org/10.1364/JOSA.57.001105

T. S. Trowbridge and K. P. Reitz. 1975. Average irregularity representation of a rough surface for ray reflection. *J. Opt. Soc. Am.* 65, 5 (May 1975), 531–536. https://doi.org/10.1364/JOSA.65.000531

B. Walter, S. R. Marschner, H. Li, and K. E. Torrance. 2007. Microfacet Models for Refraction Through Rough Surfaces. In *Computer Graphics Forum, EGSR proceedings*.

Beibei Wang, Wenhua Jin, Miloš Hašan, and Ling-Qi Yan. 2022. *SpongeCake: A Layered Microflake Surface Appearance Model*. *ACM Trans. Graph*. 42, 1, Article 8 (sep 2022), 16 pages. https://doi.org/10.1145/3546940

Feng Xie and Pat Hanrahan. 2018. Multiple Scattering from Distributions of Specular V-Grooves. *ACM Trans. Graph*. 37, 6, Article 276 (dec 2018), 14 pages. https://doi.org/10.1145/3272127.3275078

Tizian Zeltner, Brent Burley, and Matt Jen-Yuan Chiang. 2022. Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines. In *ACM SIGGRAPH 2022 Talks* (Vancouver, BC, Canada) (*SIGGRAPH '22*). Association for Computing Machinery, New York, NY, USA, Article 7, 2 pages. https://doi.org/10.1145/3532836.3536240