Simon Lucas

Mickaël Ribardière

Romain Pacanowski

Pascal 2023 Barla

A Micrograin BSDF Model for the Rendering of Porous Layers

Keywords:

. 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.

 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 lightdependent filling factor to blend between the porous and base layers. All the derived terms show excellent agreement when compared against numerical simulations.

]. 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.

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. [START_REF] Müller | Efficient Rendering of Heterogeneous Polydisperse Granular Media[END_REF]), or must be restricted to simpler configurations to yield suitable BRDF approximations (e.g., [d'Eon 2021;[START_REF] Hapke | Theory of Reflectance and Emittance Spectroscopy[END_REF]). 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 [START_REF] Torrance | Theory for Off-Specular Reflection From Roughened Surfaces[END_REF]. 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 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.

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 [START_REF] Cook | A Reflectance Model for Computer Graphics[END_REF][START_REF] Torrance | Theory for Off-Specular Reflection From Roughened Surfaces[END_REF][START_REF] Walter | Microfacet Models for Refraction Through Rough Surfaces[END_REF]] 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 [START_REF] Torrance | Theory for Off-Specular Reflection From Roughened Surfaces[END_REF] or Smith's representation [START_REF] Ashikhmin | A microfacet-based BRDF generator[END_REF][START_REF] Smith | Geometrical shadowing of a random rough surface[END_REF]] for more physically-plausible results. Their elementary reflectance can be perfectly specular (through a Fresnel term in many cases) [START_REF] Cook | A Reflectance Model for Computer Graphics[END_REF] or Lambertian [START_REF] Oren | Generalization of Lambert's Reflectance Model[END_REF]. 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 [START_REF] Bitterli | A Position-Free Path Integral for Homogeneous Slabs and Multiple Scattering on Smith Microfacets[END_REF][START_REF] Heitz | Multiple-Scattering Microfacet BSDFs with the Smith Model[END_REF] or analytic models for v-grooves [START_REF] Ho | Practical Multiple Scattering for Rough Surfaces[END_REF][START_REF] Xie | Multiple Scattering from Distributions of Specular V-Grooves[END_REF]. 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 [START_REF] Conty | Production Friendly Microfacet Sheen BRDF[END_REF][START_REF] Zeltner | Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines[END_REF]). In this paper, we focus on porous materials, which also exhibit back-scattering effects. [START_REF] Merillou | A BRDF postprocess to integrate porosity on rendered surfaces[END_REF] 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., [START_REF] Barla | A Composite BRDF Model for Hazy Gloss[END_REF][START_REF] Eugene D'eon | Microfacet theory for non-uniform heightfields[END_REF][START_REF] Dupuy | Additional Progress towards the Unification of Microfacet and Microflake Theories[END_REF][START_REF] Wang | SpongeCake: A Layered Microflake Surface Appearance Model[END_REF]), 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.

OVERVIEW

We assume that a porous material is made of a mono-disperse distribution of microscopic spherical grains of radius 𝑟 𝑠 which, depending on their density 𝜌, may interpenetrate to form aggregates and/or leave gaps that open pores in the material. As shown in Figure 2, r s β r s Fig. 2. A porous layer is modelled as a distribution of opaque half-ellipsoids (micrograins in blue) on an arbitrary bulk material (hatched region).

the micrograins are distributed on a bulk material, with their upper parts sticking out of the surface and vertically compressed by an anfractuosity parameter 𝛽 ∈ [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:

𝑓 𝑟 (i, o) = 𝑤 + (i, o) 𝑓 𝑆 𝑟 (i, o) + 1 -𝑤 + (i, o) 𝑓 𝐵 𝑟 (i, o), (1)
where 𝑓 𝑆 𝑟 and 𝑓 𝐵 𝑟 are surfacic (porous) and bulk BRDF components respectively, and 𝑤 + 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 𝑓 𝑆 𝑟 as the sum of a diffuse Lambertian term and a microfacet-based specular component:

𝑓 𝑆 𝑟 (i, o) = 𝐾 𝑑 𝜋 T (i, o) + 𝐷 (h)𝐺 (i, o)𝐹 (i • h) 4|i • n| |o • n| , (2)
with n and h = i+o ∥i+o∥ the geometric normal and the halfway vector respectively, 𝐾 𝑑 the diffuse albedo of grains, T an integrated transmittance used for energy conservation1 , 𝐷 the normal distribution function (NDF) of grain aggregates with 𝐺 the corresponding geometric attenuation factor (GAF), and 𝐹 the Fresnel reflectance.

In the following, we first derive the NDF 𝐷 in Section 4. We then compute in Section 5 a visibility term that is both used in the definition of the weight 𝑤 + and of the GAF 𝐺. 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 𝑤 + is itself reciprocal, which is indeed the case (see Equation 24).

NORMAL DISTRIBUTION FUNCTION

Intuitively, the NDF 𝐷 may be determined in two steps: for a given point 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 𝑟 𝑠 , then we might project x onto the (spherical or elliptic) grain surface to retrieve a microfacet normal 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.

Distribution of closest grains

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

x Geometric surface point m Micrograin surface normal X(m) Mapping from micrograin to geometric surface

𝜌

Micrograin distribution density 𝑟 𝑠

Micrograin radius 𝛽 Micrograin anfractuosity p (1) Distribution of distances to the closest grain P (1) Cumulative distribution of distances to the closest grain 𝐷 (m) Micrograin normal distribution function 𝜏 0 Filling factor at normal incidence 𝜏 + 𝛽 (𝜃 ) Visible filling factor at incidence 𝜃 𝑤 + (𝜃 𝑖 , 𝜃 𝑜 ) Weight of the micrograin layer Table 1. Summary of main notations discs. We thus consider here the distribution of 𝑛 discs of center c 𝑖 (1 ≤ 𝑖 ≤ 𝑛) in the 2D plane. For a given 2D point x, the distance to the center of the closest disc is written as:

𝑑 ★ (x) = min 𝑖 ∥x -c 𝑖 ∥ = ∥x -c ★ ∥ (3)
where c ★ is the disc center that is closest to x.

We want to determine the probability density function p(𝑑 ★ (x) = 𝑟 ) that gives the likelihood of c ★ to be at a distance 𝑟 of x. This corresponds to the first order statistic (cf. [START_REF] Herbert | An analytic BRDF for materials with spherical Lambertian scatterers[END_REF]), which we write p (1) (𝑟 ) p(𝑑 ★ (x) = 𝑟 ) in the following. 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

(1) n (𝑟 ). In a circular region of radius 𝑅 and center x, there are n = 𝜋𝑅 2 𝜌 discs, with 𝜌 the grain density (see Figure 3). The proportion of discs whose centers are at a distance 𝑑 (x) smaller than 𝑟 is given by:

P n (𝑟 ) p n (𝑑 (x) ≤ 𝑟 ) = 𝜋𝑟 2 𝜌 𝜋𝑅 2 𝜌 = 𝑟 2 𝑅 2 , (4)
which is a cumulative distribution function (CDF). The proportion of discs whose centers are at a distance 𝑟 then corresponds to the following probability distribution function (PDF):

p n (𝑟 ) p n (𝑑 (x) = 𝑟 ) = 𝜕P n 𝜕𝑟 (𝑟 ) = 2𝑟 𝑅 2 .
(5)

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

p (1) n (𝑟 ) = np n (𝑟 ) [1 -P n (𝑟 )] n-1 . (6)
Using Equations 4 and 5 along with 𝑅 2 = n 𝜋 𝜌 , we obtain:

p (1) n (𝑟 ) = 2𝜋 𝜌𝑟 1 - 𝜋 𝜌𝑟 2 n n-1 . ( 7
)
The first-order statistic p (1) (𝑟 ) for an infinite surface is then obtained by taking the limit of Equation 7when 𝑅 tends toward infinity, or equivalently when 𝑛 tends toward infinity:

p (1) (𝑟 ) = lim n→∞ p (1) n (𝑟 ) = 2𝜋 𝜌𝑟𝑒 -𝜋 𝜌𝑟 2 . ( 8
)
The associated CDF P (1) (𝑟 ) is obtained by integration:

P (1) (𝑟 ) = ∫ 𝑟 0 p (1) (𝑟 ′ )d𝑟 ′ = 1 -𝑒 -𝜋 𝜌𝑟 2 . ( 9
)
Lastly, the probability that the center of the closest disc is at polar coordinates (𝑟, 𝜙) is computed using the following PDF:

p (1) (𝑟, 𝜙) = p (1) (𝑟 )p(𝜙) = 𝜌𝑒 -𝜋 𝜌𝑟 2 , ( 10
)
where we have used a uniform angular distribution 𝑝 (𝜙) = 1 2𝜋𝑟 . In Figure 4(a), we show the distribution of distances to the closest disc p (1) (𝑟 ) for several densities of micrograins, and compare our analytic formula to numerical simulations.

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 𝑟 𝑠 , the grain radius (i.e., 𝑟 ≤ 𝑟 𝑠 ). Such a constraint is met by construction if we use a function X : Ω → R 2 that projects a point on the closest grain onto the surface, which maps a normal m = (𝜃 𝑚 , 𝜙 𝑚 ) on the grain surface to a 2D point of the plane x = (𝑟, 𝜙) (see Figure 3):

p (1) ((𝑟, 𝜙) ∩ 𝑟 < 𝑟 𝑠 ) = p (1) (X(m)). ( 11
)
The likelihood that the point on the closest grain has a normal m is then given by p (1) (m) = p (1) ((𝑟, 𝜙) | 𝑟 < 𝑟 𝑠 ). Using Bayes' theorem then Equation 11, we have:

θ = 0 π/4 π/2 0 0.81 D(θ) τ0 = 0.2 τ0 = 0.5 τ0 = 0.9 θ = 0 π/4 π/2 0 3.26 D(θ) τ0 = 0.2 τ0 = 0.5 τ0 = 0.9 θ = 0 π/4 π/2 0 81.44 D(θ) τ0 = 0.2 τ0 = 0.5 τ0 = 0.9 (a) 𝛽 = 1 (b) 𝛽 = 0.5 (c) 𝛽 = 0.1
p (1) (m) = p (1) ((𝑟, 𝜙) ∩ 𝑟 < 𝑟 𝑠 ) p (1) (𝑟 < 𝑟 𝑠 ) = p (1) (X(m)) P (1) (𝑟 𝑠 ) . ( 12
)
The denominator in Equation 12 corresponds to the surfacic filling factor (see Equation 9), as illustrated in Figure 4(b):

𝜏 0 = P (1) (𝑟 𝑠 ) = 1 -𝑒 -𝜋 𝜌𝑟 2 𝑠 . ( 13
)
We explain in details in Supplemental Material how to derive the NDF 𝐷 (m) from p (1) (m). We start by normalizing p (1) (𝑟 ) for 𝑟 ∈ [0, 𝑟 𝑠 ], which after several simplifications yields:

∫ Ω p (1) (m)𝑟 (𝜃 𝑚 ) 𝐽 𝑟 (𝜃 𝑚 ) sin 𝜃 𝑚 d𝜔 𝑚 = 1, (14)
where we have used X(m) = (𝑟 (𝜃 𝑚 ), 𝜙 𝑚 ) since grains are radially symmetric, and where 𝐽 𝑟 (𝜃 𝑚 ) is a Jacobian associated to 𝑟 (𝜃 𝑚 ).

Then, by analogy with the normalization constraint of NDFs (i.e., ∫ Ω 𝐷 (m) cos 𝜃 𝑚 d𝜔 𝑚 = 1), we obtain:

𝐷 (m) = p (1) (m)𝑟 (𝜃 𝑚 )𝐽 𝑟 (𝜃 𝑚 ) sin 𝜃 𝑚 cos 𝜃 𝑚 . ( 15
)
Lastly, after deriving expressions for p (1) (m), 𝑟 (𝜃 𝑚 ) and 𝐽 𝑟 (𝜃 𝑚 ) in the case of an ellipsoid, we obtain:

𝐷 (m) = 𝛽 2 𝜌𝑟 2 𝑠 𝑒 -𝜋 𝜌𝑟 2 𝑠 tan 2 𝜃𝑚 𝛽 2 +tan 2 𝜃𝑚 (1 -𝑒 -𝜋 𝜌𝑟 2 𝑠 )(𝛽 2 + tan 2 𝜃 𝑚 ) 2 cos 4 𝜃 𝑚 , (16)
where 𝛽 ∈ [0, 1] controls the anfractuosity of grains on the surface. Using the surfacic filling factor 𝜏 0 , we may rewrite the NDF as a variant of the GGX NDF:

𝐷 (m) = - ln(1 -𝜏 0 )(1 -𝜏 0 ) tan 2 𝜃𝑚 𝛽 2 +tan 2 𝜃𝑚 𝜏 0 𝐷 GGX (m), ( 17
)
where 𝛽 is used to control roughness in 𝐷 GGX . When 𝜏 0 tends toward 0, the prefactor in Equation 17 tends toward 1 and 𝐷 tends toward 𝐷 GGX . Intuitively, the lower 𝜏 0 , the more grains get isolated from each other, making 𝐷 tend toward the NDF of individual ellipsoids. Hence for 𝜏 0 = 0, 𝛽 is identical to the GGX roughness parameter 𝛼.

Figure 5 shows our NDF for several values of anfractuosity 𝛽 and filling factor 𝜏 0 , along with comparisons with numerical simulations. Increasing the filling factor 𝜏 0 increases the inter-penetration of micrograins, in effect decreasing the roughness of the porous layer for a constant 𝛽. This might be undesired for artistic control. Therefore, we introduce an equivalent roughness parameter α that is linearly related to 𝛽 by imposing that 𝐷 GGX = 𝐷 for 𝜃 𝑚 = 0, yielding: α2

𝜋 α4 = - ln(1 -𝜏 0 )𝛽 2 𝜏 0 𝜋 𝛽 4 , α = 𝛽 √ - 𝜏 0 ln(1 -𝜏 0 ) . ( 18
)
The maximum achievable equivalent roughness αmax thus depends on 𝜏 0 and is obtained when 𝛽 = 1 in Equation 18, as shown in Supplemental Material. In practice, we limit 𝜏 0 to 0.98 to ensure that αmax > 0.5, granting sufficient artistic control.

Importance Sampling

We follow the microfacet framework described in [START_REF] Walter | Microfacet Models for Refraction Through Rough Surfaces[END_REF]] 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 𝐷 (𝜃 𝑚 ) cos 𝜃 𝑚 is given by:

𝐶 (𝜃 𝑚 ) = 1 -𝑒 -𝜋 𝜌𝑟 2 tan 2 𝜃𝑚 𝛽 2 +tan 2 𝜃𝑚 1 -𝑒 -𝜋 𝜌𝑟 2 = P (1) (𝑟 𝑠 (𝜃 𝑚 )) 𝜏 0 , (19)
while the corresponding inverse CDF is given by:

𝐶 -1 (𝜉) = arctan 𝛽 √ - ln(1 -𝜉𝜏 0 ) ln(1 -𝜉𝜏 0 ) -ln(1 -𝜏 0 ) . (20)
Therefore, (𝜃 𝑚 , 𝜙 𝑚 ) = (𝐶 -1 (𝜉 1 ), 2𝜋𝜉 2 ) where 𝜉 1 and 𝜉 2 are uniformlydistributed random variables.

VISIBILITY TERMS

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

Visible Filling factor

θ Fig. 6. The distribution of spherical micrograins seen from an angle 𝜃 is obtained by a mere projection of the original distribution of micrograins. This has the effect of increasing the effective density.

The surfacic filling factor 𝜏 0 corresponds to the proportion of grains on the surface visible at normal incidence. We also want to characterize the visible filling factor 𝜏 𝛽 (𝜃 ) from a direction of elevation 𝜃 , which differs from 𝜏 0 since grains then tend to mask each others in a way that depends on the anfractuosity 𝛽.

When 𝛽 = 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 𝑟 𝑠 , but a higher density, yielding 𝜏 1 In the general case (𝛽 ∈ [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 𝛾 𝛽 (𝜃 ) the compression factor of these ellipses, we can find an equivalent distribution of discs using a modified density, as in the following:

(𝜃 ) = 1 -𝑒 -𝜋𝑟 2 𝑠 𝜌 cos 𝜃 .
𝜏 𝛽 (𝜃 ) = 1 -𝑒 -𝜋𝑟 2 𝑠 𝜌 𝛾 𝛽 (𝜃 ) cos 𝜃 = 1 -(1 -𝜏 0 ) 𝛾 𝛽 (𝜃 ) cos 𝜃 . (21)
To compute 𝛾 𝛽 (𝜃 ), we assume without loss of generality that 𝑟 𝑠 = 1. In the incidence plane (see Figure 8), the slice of an ellipsoid then yields an ellipse of radii 1 and 𝛽 in horizontal and vertical directions respectively. The equation of the two lines of slope cos 𝜃 sin 𝜃 (our direction of interest) and tangent to such an ellipse is given by: cos 𝜃𝑥sin 𝜃𝑦 ± √ cos 2 𝜃 + 𝛽 2 sin 2 𝜃 = 0.

The compression factor 𝛾 𝛽 (𝜃 ) = √ cos 2 𝜃 + 𝛽 2 sin 2 𝜃 then corresponds to the distance of either of these lines to the origin. When 𝛽 = 0 (flattened grains), we have 𝜏 0 (𝜃 ) = 𝜏 0 for all 𝜃 . Moreover, at normal incidence, we retrieve 𝜏 𝛽 (0) = 𝜏 0 regardless of 𝛽. Only the upper part of grains should contribute to the surfacic BRDF component. The corresponding visible surfacic filling factor 𝜏 + 𝛽 (𝜃 ) is given by a formula similar to that of Equation 21, the only difference being that 𝛾 𝛽 (𝜃 ) is replaced by 𝛾 + 𝛽 (𝜃 ) = 1 2 (𝛾 𝛽 (𝜃 ) + cos 𝜃 ). Indeed, as already observed by Heitz [START_REF] Heitz | Sampling the GGX Distribution of Visible Normals[END_REF]] 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 𝛽, the other being the projection of a disc (i.e., 𝛽 = 0). After some simplifications, this yields:

𝜏 + 𝛽 (𝜃 ) = 1 - √ 1 -𝜏 𝛽 (𝜃 ) (1 -𝜏 0 ). ( 22
)
Figure 9 shows the visible filling factor function 𝜏 + 𝛽 (𝜃 ) for various configurations of filling factors 𝜏 0 and anfractuosity 𝛽, along with comparisons to numerical simulations.

θ = 0 π/4 π/2 0 0.1 1 β = 1.0 β = 0.5 β = 0.1 θ = 0 π/4 π/2 0 0.4 1 β = 1.0 β = 0.5 β = 0.1 θ = 0 π/4 π/2 0 0.8 1 β = 1.0 β = 0.5 β = 0.1 (a) 𝜏 0 = 0.1 (b) 𝜏 0 = 0.4 (c) 𝜏 0 = 0.8
Fig. 9. The visible filling factor 𝜏 + 𝛽 is shown for three values of 𝜏 0 and 𝛽. As expected, all curves start at 𝜏 0 for 𝜃 = 0 and end up at 1 for 𝜃 = 𝜋 2 . Comparisons with numerical simulations (dots) show excellent agreement.

The weight factor 𝑤 + 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 -𝜏 0 , and the visibility probability of a point x knowing that x is in a pore is given by 1-𝜏 + 𝛽 (𝜃 )

1-𝜏 0 , yielding:

𝑤 + (i, o) = 1 - (1 -𝜏 + 𝛽 (𝜃 𝑖 ))(1 -𝜏 + 𝛽 (𝜃 𝑜 )) 1 -𝜏 0 . ( 23
)
Using Equation 22, this simplifies to:

𝑤 + (i, o) = 1 - √ (1 -𝜏 𝛽 (𝜃 𝑖 ))(1 -𝜏 𝛽 (𝜃 𝑜 )). ( 24
)
Note that we assume that there is no correlation between i and o; hence we consider the validation of 𝑤 + to follow from that of 𝜏 + 𝛽 .

Geometric term

We are now left with the derivation of the geometric term 𝐺, which may be computed (cf. [START_REF] Heitz | Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs[END_REF]) from 𝐺 1 (𝜃 ) = 1 1+Λ(𝜃 ) . The computation of Λ(𝜃 ) 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:

Λ(𝜃 ) = 𝜋 𝜌𝑟 2 𝑠 2(𝑒 𝜋 𝜌𝑟 2 𝑠 -1) cot 𝜃 +∞ ∑ 𝑛=0 (𝜋 𝜌𝑟 2 𝑠 ) 𝑛 𝐹 𝑛 (𝛽, cot 𝜃 ). ( 25
)
In practice, the five first terms of the series (i.e., 𝑛 = 4) give a very close approximation. An alternative consists in using the Λ(𝜃 ) term associated with the GGX distribution, using the equivalent roughness of Equation 18. We compare both solutions to a reference obtained with 𝑛 = 20 in Figure 10

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. [START_REF] Merillou | A BRDF postprocess to integrate porosity on rendered surfaces[END_REF][START_REF] Eugene D'eon | Microfacet theory for non-uniform heightfields[END_REF]]. 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, 𝑤 + ). 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 𝜃 𝑖 = 0, yielding:

(1 -𝑤 𝐴 ) 1 𝐺 α (0,𝜃 𝑜 ) = 1 -𝑤 + (0, 𝜃 𝑜 ) = 1 -𝜏 + 𝛽 (𝜃 𝑜 ), (26)
where 𝑤 𝐴 denotes the parameter in the model of d'Eon et al. and 𝐺 α is the GGX GAF where we set roughness from 𝛽 using Equation 18. However, note that there is no simple bijection between the two models, since Equation 26 still depends on 𝜃 𝑜 . If we further enforce 𝜃 𝑜 = 0 in Equation 26, we then get 𝑤 𝐴 = 𝜏 0 . As shown in Figure 11 for two values of 𝜃 𝑜 , 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 -𝜏 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. [START_REF] Eugene D'eon | Microfacet theory for non-uniform heightfields[END_REF]] on renderings, using 𝑤 𝐴 = 𝜏 0 and 𝛼 = α. The differences between the two models are subtle, and mainly show up for large values of 𝜏 0 and small values of α. 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 [START_REF] Walter | Microfacet Models for Refraction Through Rough Surfaces[END_REF]] (which does not vary with 𝜏 0 ) for reference in Figure 12(b).

When using our GAF formulation with 𝑛 = 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 [START_REF] Walter | Microfacet Models for Refraction Through Rough Surfaces[END_REF]]. This overhead vanishes when we use the approximate GGX GAF. Parameter variations. Next, we demonstrate different homogeneous material configurations in simple scene settings, all rendered within Mitsuba 3 [START_REF] Wenzel | Mitsuba 3 renderer[END_REF]. 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 approximation can be achieved by using the stochastic model of [START_REF] Heitz | Implementing a Simple Anisotropic Rough Diffuse Material with Stochastic Evaluation[END_REF].

In Figure 13, we pick an anfractuosity 𝛽 per type of micrograin and show renderings for an intermediate filling factor 𝜏 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 nonporous materials), dirty-looking surfaces.

Surface-varying materials. Figure 1 showcases several material configurations where we have used textures to control the filling factor parameter 𝜏 0 in our model. Note that the 𝑤 𝐴 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 𝜏 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 𝜏 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 𝜏 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 surface, with different paint thicknesses reproduced via the 𝜏 0 texture, yielding different appearance under different light directions.

DISCUSSION

We have introduced a phyisically-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 [START_REF] Bitterli | A Position-Free Path Integral for Homogeneous Slabs and Multiple Scattering on Smith Microfacets[END_REF][START_REF] Heitz | Multiple-Scattering Microfacet BSDFs with the Smith Model[END_REF]] 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 Atasanov et al. [START_REF] Atanasov | Microsurface Transformations[END_REF]] 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 grazingangle effects, sheen models [START_REF] Conty | Production Friendly Microfacet Sheen BRDF[END_REF][START_REF] Zeltner | Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines[END_REF]] 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 occuring in an half-ellipsoid. 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;[START_REF] Hapke | Theory of Reflectance and Emittance Spectroscopy[END_REF]), 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. . 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 ★. 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 𝑤 + . 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.

  Fig.3. Left: A distribution of discs of radius 𝑟 𝑠 in a region of radius 𝑅 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 = X (m) of the plane that lies at a distance 𝑟 ≤ 𝑟 𝑠 to the micrograin center c ★ .

Fig

  Fig. 4. (a) Comparison of the distribution of distances to the closest disc center p (1) (𝑟 ) (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 𝑟 = 𝑟 𝑠 yields the filling factor 𝜏 0 .

Fig. 5 .

 5 Fig. 5. Illustration of our micrograin NDF 𝐷 for several values of 𝛽 and 𝜏 0 . Increasing 𝜏 0 for a fixed 𝛽 yields a sharper distribution. Numerical simulations are shown with dots.

  Fig. 7. (a) At normal incidence, the filling factor 𝜏 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 𝛽 = 0.8). Only the upper halves of ellipsoids (in blue) must be considered.

  Fig.8. A micrograin seen from a direction of elevation 𝜃 (in green) shows as an ellipse compressed by a factor 𝛾 𝛽 in the vertical direction. It corresponds to the distance of tangent lines of elevation 𝜃 (in black) to the origin.

Fig. 10 .

 10 Fig.10. The 𝐺 1 term of the GAF for our NDF is shown in the critical configuration where 𝜏 0 = 0.98 for two values of 𝛽. Using the GGX 𝐺 1 term yields a conservative approximation, which is often sufficient for lower 𝜏 0 values.

Fig. 11 .

 11 Fig. 11. The weight mixture functions of three models are compared: Merillou[START_REF] Merillou | A BRDF postprocess to integrate porosity on rendered surfaces[END_REF]] (dotted), d'Eon[d'Eon et al. 2023] (dashed) and ours (solid). The anfractuosity is set to 𝛽 = 0.5, from which an equivalent roughness parameter α is computed for the first two models. Even though the three models may be made equal at 𝜃 𝑖 = 𝜃 𝑜 = 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.

  Comparison with d'Eon et al. [d'Eon et al. 2023] (b) Comparison with Walter et al.[START_REF] Walter | Microfacet Models for Refraction Through Rough Surfaces[END_REF]

Fig. 12 .

 12 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 α. 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 .

We use an approach inspired by Mitsuba[Jakob et al.

2022] as detailed in supplemental material

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.