Computer Graphics & Geometry

Simulation of sparkles of metallic paints

Sergey V.Ershov,
res. fellow of the Keldysh Institute of
Applied Mathematics.
Dept. of Math, MSU.

e-mail:
measure@spp.keldysh.ru

Andrei B. Khodulev,
senior researcher of Keldysh Institute of
Applied Mathematics.
e-mail:
abkhod@gin.keldysh.ru

Konstantin V. Kolchin,
researcher of Scientific and Technological
Computational Center of Keldysh Institute of
Applied Mathematics.
e-mail:
okk@gin.keldysh.ru



Abstract: Metallic and pearlescent paints contain flakes and exhibit strong texture (spatial fluctuations of luminance) and sparkles (rare, extremely bright tiny points). We present an algorithm for calculating these texture and sparkles during image rendering.

Key words: BRDF, paint texture.


1. Introduction

Nowadays the so-called "metallic finishes" are widely used in automotive and other industries. These materials are paints or plastics having metal or mica flakes in a transparent resin [1].

Metallic paints have different macro and micro appearance. Macro appearance can be described by BRDF, which can be calculated using a virtual goniospectrophotometer [2].

The main feature of the micro appearance of metallic paints is an irregular random texture looking like bright sparkles (whose color is different from that of the resin or the base coat) dusted on the paint [1].

For majority of paints the sparkling granules (shining flakes) are very clearly visible. They are visible from the distance of several meters. Sparkles are visible in case of illumination with parallel light; under diffuse illumination they nearly vanish.

2. Objectives

In human perception of modern composite paints an important role is played by "sparkling": under directional illumination, paint surface looks as if "dusted" with tiny shining sparkles, usually with colour different from that of "background". In other words, these paint have some texture. When observed from far distance, these sparkles get "merged" due to finite resolution of human eye, and we see exactly what is represented by BRDF.

This texture is irregular, random fluctuations of brightness and, optionally, colour. It is due to presence of flakes. Indeed, since composite paint is composed of substrate

binder (resin) flakes dispersed in that binder then the light reflected by paint consists, roughly speaking, of three components:

Certainly, besides these "pure" components their are various "mixtures", e.g. the light reflected by the substrate then reflected by a flake backwards and then reflected by the substrate into the eye. But these components are inessential for the qualitative explanation below.

The flake component is not uniform, because flakes do not cover the entire surface and thus one ray encounters a flake while another one misses it. So reflectance by flake ensemble is non-uniform: it fluctuates and so "texturizes" the paint.

The ray reflected by a flake can reach observer either directly (in one scattering), or after several scatterings (by other flakes or by the substrate or by the paint-air boundary). However, each reflection substantially attenuates light, thus it is the flakes seen "directly" that are the brightest; it is them that look like sparkles. Under parallel illumination, they look like a mirror in a sunny day. Like that mirror, they are visible only if they have proper orientation; a slight deviation from it makes the reflected light missing the eye. Therefore, visible directly are only flakes with "proper" orientation; and thus they are rather rare. This is illustrated by the figure below:


Figure 1: Reflection by flakes. Only one flake is a "sparkle": the one that reflects light directly onto observer. The light reflected by other flake undergoes several reflections, thus it is attenuated and these flakes are not sparkles

Let us summarize. If illuminated by parallel light, there are rather rare bright points that have the colour of flakes. They are "dusted" on the regular (uniform) background that has colour of substrate. Since these sparkles are rather rare (e.g each 100th flake), they are separated from each other by distance enough for an eye to distinguish between them. Thus we see individual sparkles, at least from close distance. But while watched from far distance, the eye merges them and so the fluctuations vanish (due to averaging).

While illuminated by diffuse (ambient) light, the sparkles are also less pronounced. This is due to two reasons. Imagine a mirror in a cloudy day. It is seen at any orientation, but never blinds one. Similarly, nearly any flake is visible, but its brightness is small. So "sparkles" are weak and dense; due to the last reason they can not be distinguished by eye; so it averages brightness over several sparkles and thus diminishes fluctuations even more.

So we conclude that paint texture, while clearly visible under sun light, nearly disappears under ambient light.

3. Simulation of sparkling

The idea of simulation is to calculate statistical characteristics of fluctuations due to scattering by flakes and then

reproduce the paint texture by superimposing random fluctuations on the image obtained by standard rendering.

4. Constraints

Accurately as we can determine statistical characteristics, because of hardware constraints (finite resolution and dynamic range of brightness), we shall be able to simulate the “close look” of paint only.

Characteristics of distribution of brightness of sparkles are calculated accurately for top flakes only. To account for deeper flakes, which are “less visible” and make smaller contribution to sparkling, we use a simple, though quite artificial trick of scaling the top distribution (see Section 5.3.2).

5. Algorithms
5.1. Definitions, notations etc.

Sparkles are nothing but fluctuations of brightness. In a stochastic medium, when scattering particles have random position, orientation and size, the scattering conditions for different rays are different; and so is the brightness of reflected rays. It fluctuates, which we perceive as a sparkling texture.

This phenomenon is rather particular. It is only for flat smooth flakes that some (rare) rays undergo single reflection before hitting the observer. These rays are much brighter than those that underwent several reflections and are therefore seen as shining sparkles.

This is because sparkles are due to single reflection while texture is mainly due to multiple reflections, strongly determined by correlations in position and orientation of nearby flakes.

5.2. Visibility of random textures and sparkles

Despite any stochastic medium (e.g. milk) does represent fluctuations of brightness, they are only visible if their correlation length is large enough, on the order (or better greater than) of an eye resolution. Otherwise, fluctuations are nearly suppressed due to spatial averaging. Since correlation length is determined by the size of particles and distance between them, we may expect that a visible texture is more pronounced in case of paint thick with flakes of size >0.05 mm.

One can calculate how the visibility of texture and sparkles decreases with distance. For texture, we shall assume that correlation length is very small, much less than the resolution of an observer. For sparkles which are very rare, it seems reasonable to assume that the typical distance between them is much greater that the resolution of an observer.

Let us begin with sparkles. Usually, these are rare, so a human eye can always distinguish different sparkles. Therefore, it suffices to consider a unique sparkle. A human eye perceives a tiny bright point (of actual size << than the eye resolution) as a light source that emits the same energy as original one, but with visible size exactly equal to ‘pixel’ size.

Moreover, while in calculation of the luminance that energy must be divided by the solid angle of the cone of rays that reach the observer, i.e. by its squared angular size times .

Therefore, the visible luminance is

(1)

where E is the energy emitted by the sparkle, o is the angular size of the observer, is the area of projection of the pixel onto the surface, and is the angle between observation direction and surface normal.

Now let us come to regular texture. A human eye, as well as any optical device, performs averaging over the visible pixel. Assuming that flakes are statistically independent and their size is much smaller than the pixel size, we conclude that fluctuations of luminance are created by O( ) statistically independent sources, where is the area of the pixel’s projection onto the surface,  R2. Thus the deviation of visible luminance scales as

(2)

and so the visibility of sparkles decreases faster than that of regular texture.

5.3. Sparkles as fluctuations of brightness
5.3.1. Topmost sparkles (thin layer)

By topmost flakes we mean those which are neither shadowed nor masked by other flakes; thus no multiflake effects take place and it suffices to consider a single flake.

Consider a flake (=tiny mirror) of size S and orientation (the angle between flake and paint normals) , and denote the reflectivity of its surface as rp(a ) where a is the angle of incidence with respect to flake’s normal. Since reflection is specular, the energy reflected by this mirror is

(3)

where J ¢ is the angle of incidence counted from the paint’s normal, and I is illuminance of the paint surface, so I/cosJ ¢ is the energy flux per unit area normal to the ray and is the energy fallen onto the flake.

Obviously, the above formula is only valid if the flake reflects the direct incident light into observer. That is, its normal must be close to

where v¢ and v are the illumination and observation directions, and nf is flake’s normal. Admissible deviation of the normal from nf is determined by the angular size of the LS (we neglect that of the observer e.g. eye pupil): it is such variation of the flake’s normal that for fixed v the resulting deviation of v¢ does not exceed angular size of the LS D .

According to eq.(54) of [2], the relation between deviations is

wherea is the angle of incidence/reflection with respect to flake’s surface: . For an axisymmetrical LS, .

The probability that flake’s normal belongs to this cone is P(nf)d2nf. The density P(nf) depends on the polar angleb of the flake’s normal (counted from the paint normal n) only, thus P(nf) = P(b )/2p and the probability of finding a flake with “proper” orientation is

(4)

The angle b can be calculated from obvious relation: .

Therefore, the energy emitted by a flake is “0” with probability 1–Pr (specular reflection) or E given by (3) with probability Pr(specular reflection).

The value E is a function of two random variables: flake area S and its orientation b . We can therefore calculate it by picking two random deviates for S and ;

The first one is usually a normal deviate. The angle b can be obtained with a uniform deviate. Indeed, the energy is distinct from zero only if b is in a tiny interval, and within this interval we can approximate any smooth distribution P(b ) with a constant. Therefore, the conditional distribution of b , i.e. its distribution for sparkling flakes is uniform. As to the flake’s area, it usually has normal distribution so one can easily generate

The idea of simulation is therefore like this: for a given cell, “cycle” over all flakes in it, choose the flake to be a sparkle with probability Pr(...); if yes, pick at random its size and orientation and calculate its energy. Should there be several sparkles, their energies are summed up.

Such a straightforward approach is hardly sensible since there are thousands of flakes in mesh cell! And the probability of “success” is very small for the necessary range of orientation is very narrow. Thus we have a long series of trials with tiny probability of success. The number of “successes”, i.e. sparkles N is therefore a Poisson deviate whose mean is the average number of sparkles per unit area, i.e. the probability Pr(...) times the number of the topmost flakes. Should we know the latter, we would be able to calculate á Nñ , then pick N as a Poisson deviate with this mean, and then determine characteristics of these N (a few!) sparkles only.

The difficulty is that the number of “topmost flake” is undefined. And this is because it is impossible to discard deeper flakes at all; they also contribute to sparkles but this contribution quickly decreases with depth. Below we shall consider two simple ways of how to take this into account.

5.3.2. Accounting for deeper flakes.

It is very difficult to calculate the distribution of sparkles due to deep flakes because that will require to take into account the masking/shadowing of deep flakes by the top ones, the more so that masking/shadowing is only partial since flakes may be transparent. In case of large density of flakes (a usual case with paints), this effect is strongly determined by correlations between positions and orientations of nearby flakes which are unknown. We can certainly perform a sort of “mini ray-tracing” to find the distribution of the reflected light, but that will be too expensive.

Happily, since the visible area of deep flakes is much less than that of the topmost ones; so their contribution to bright sparkles is not very substantial, and we can try a simple approximation.

The idea is like this: we know that the light emitted from inside paint attenuates as , where t (J ) is the optical thickness per unit path of a ray with polar angle J . Similarly, the incident radiation attenuates times.

This attenuation also applies to sparkles, and can be attributed to:

  • Decay of light, while the probability of facing a sparkle (of any energy) is independent of depth.
  • Decay of probability of facing a sparkle (of any energy), while the light is not attenuated in the medium: we assume that sparkles are flakes that are neither shadowed nor masked; the deeper the fewer such flakes.
  • Both assumptions are extreme cases, but accurate treatment is too complex, and even unnecessary for visualisation. The first assumption seems more natural; however, we shall discuss both, referring to them as the model with masking/shadowing and the model without masking/shadowing.

    In the model with masking/shadowing we treat deeper flakes just as the topmost ones, only both the illuminating and reflected radiation must be attenuated. Therefore, the average number of sparkles per unit area of paint is

    (5)

    In the model without masking/shadowing, there are fewer and fewer sparkles in deep layers, the total number of sparkles per unit area of paint is

    where Pr(specular reflection) is given by (4), and the integrand gives the number of sparkles in depth interval [z, z+dz]. That is, Pr(direct, z) is the probability (not the density of distribution) that a flake is neither masked nor shadowed (i.e. visible directly). In view of definition of the optical thickness,

    where the first factor is the probability of absence of shadowing (direct illumination) and the second term is the probability of the absence of masking (direct visibility).

    Therefore,

    (6)

    Now, knowing the density of sparkles, we can calculate their mean count in the cell, and then pick their “actual” count N as a Poisson deviate for this mean. After that, we can calculate their energy. In the model without masking/shadowing it is immediately given by (3); in the model with masking/shadowing that introduces light attenuation, the result of (3) must be multiplied by the attenuation factor

    Here z is the depth; this is a random variable. In this model the probability of finding a sparkle is independent of depth, so z is a uniform deviate in [0, H].

    5.3.3. Optical thickness of paint

    For uniform paint, that contains flakes and pigment particles (see eq.(44) and Section 11.5 of [2]),

    where J is the polar angle of the ray direction with respect to paint surface, D is concentration of flakes, á á DSñ ñ is average area of flakes (single-side!) per unit volume of paint, c1 is the weight of Rayleigh scattering by pigment particles (see [2] for details), k absorption in the binder and

    where P(b ) is the distribution of polar angle b of flake’s normal (counted from the normal to the paint surface) and tp(a ) is transmittance of flake coating for angle of incidence a (measured from flake’s normal).

    In an important case when

    we have approximately

    5.3.4. Taking into account refractive index of the paint.

    Usually, flakes are dispersed in a binder that has refractive index different from that of environment. In this case the unit vectors v¢ and v of Section 5.3.5 are directions of the incident and refracted rays in the binder, that is, the directions to the LS and observer as seen from under the paint surface. The same applies to their sizes D i and D o.

    Now let us describe how to calculate these values.

    Let us begin with transformation of angular size; obviously it is the same for LS and observer. If we denote the direction of a ray in the binder as v and outside it as as V, then naturally the angular size of an object observed from the binder is

    where D actual is its size as measured from the environment. The same formulae applies to linear size of a round object.

    The relation between the differentials of solid angles can be easily derived using Snell’s law for transformation of polar angles and their differentials and keeping in mind that azimuth angles are the same. This gives:

    where J is the angle of incidence in the environment, n is the normal to the paint surface, and h  = h binder/h environment is the relative refractive index of the binder.

    Thus the size (either angular or linear) of a round object observed from the binder is

    . (7)

    REMARK. For large angles of incidence, a round object is seen as an ellipse. We neglect that distortion of shape and treat the image as a round object. This is possible because if the observer is a human eye, its size is so small that we can neglect it. For a point observer, the flake is visible when the image of the observer (as reflected by the flake and then refracted by the binder) is somewhere within the illuminaire (as seen from the binder). In this case the shape of light source is inessential: the probability that the flake is visible is just the probability that the flake’s normal is within a the given solid angle. The shape of this element is inessential! And the part of light f that reaches observer is (D o/D i)2.

    Now let us come to the transformation of the directions

    According to the Snell law,

    where subscript ‘||’ and ‘^ ’ refer to the component parallel and normal to the surface, respectively. The same transformation is valid for v¢ and V¢ . For the whole vectors, we have

    (8)

    It is the transformed variables (7) and (8) that are used in calculations of Section 5.3.5 and Section 5.3.4:

    Similarly, the sizes must be calculated with (7).

    Note that in terms like t (J )/cosJ one must replace J and J ¢ by the angles in the paint J p = arccos(v× n) and J ¢ p = arccos(v¢ × n) respectively. These can be easily calculated with the help of Snell’s law:

    .

    At last, one must take into account that some part of light falling on the surface is reflected by the Fresnel interface; equally, some part of light reflected by the flake does not leave the binder.

    5.3.5. Rendering of a sparkling surface

    The picture to be obtained is a rectangular mesh of pixels. For each of them, the TBT draws a ray from the observer (backward ray tracing), with all its possible specular reflections, until it faces a diffuse surface. One can imagine the picture as a “mask” like the one used in cathode-ray tube, with rays from the observer running through its “holes” (pixels) to the scene.

    Let us begin with the case of one point or parallel light source. Indeed, for other kinds of light sources, illumination is diffuse and does not produce sparkles.

    This sparkles must be processed for

    In either case, calculation of sparkle energy is like this:

    1) Take the position (Cartesian coordinates) of mesh cell centre, observer and light source. Draw unit vectors V¢ , V from the centre to light source and observer, resp.

    For parallel or spot light, V¢ is the direction of emitted light, not the direction to the centre of light source (even if one exists).

    2) Check if the sign of direction is correct: (n× V¢ ) and (n× V) must be positive. If not, invert the sign of all components of the vector.

    3) Calculate the angles between paint normal and rays inside the paint:

    4) Calculate refracted directions:

    and then the direction of flake’s normal for which specular reflection occurs:

    Calculate cosine of the polar angle of flake’s normal b (with respect to the local surface normal n): and cosine of the angle of incidence/reflection with respect to flake’s surface: .

    5) Calculate the angular size of observer and luminaire, as seen from the paint:

    6) Calculate the sum of optical thicknesses for these rays for unit flake depth :

    where k is absorption exponent of the binder, Dá Sñ is the total area of flakes in unit paint volume (it is this value that is usually known; besides, it is what OPPI library functions use), á sñ is average projection area of a unit flake (see [2]) á t is average reflectance of flake coating (see [2]) and c1 is scaled Rayleigh scattering coefficient of pigment particles (see [2]).

    The rather complex functions á sñ (J ) and á t(J ) are calculated with linear interpolation (using tabulated values prepared in advance). It is therefore reasonable to tabulate them as functions of cosJ , thus obviating calculation of J p = arccos(cosJ p) like it was done in OPPI task. We can thus use interpolation arrays prepared by ‘process_flakes()’ function of that library.

    7) Obtain the area of the cell (=projection of the pixel onto the surface) S and calculate the expectation of the number of sparkles in it

    for the model with masking/shadowing, and

    .

    As already mentioned, the density P(b ) is calculated with linear interpolation (using tabulated values prepared in advance) thus obviating all calls to exponential functions. It is therefore reasonable to tabulate it as a function of cosb thus obviating calculation of b  = arccos(cosb ).

    3) In case á Nñ  << 1 (namely < 0.1), pick a uniform deviate x in [0,1]; if x  £  á Nñ , then N = 1, otherwise N = 0.

    In case of greater á Nñ , pick a N as a Poisson deviate with mean á Nñ .

    4) Now if N > 0, we pick characteristics of N sparkles at random, calculate their energies (three energies for the R, G, B colours) and sum them up.

    That is, for each of N sparkles: Pick at random flake area S as normal deviate. For the “model with masking/shadowing” (where light attenuation is taken into account), pick the depth of reflection z as a uniform deviate in [0, H]. Then calculate the energy of the sparkle (the scalar below is actually one of the colour components):

    (9)

    in the “model with masking/shadowing” (the exponential factor gives attenuation of light during its path to the flake and back to the surface).

    In the “model without masking/shadowing”

    (10)

    In both cases I is illuminance of the cell (energy flux per unit surface area), so I/cosJ ¢ is the energy flux per unit area normal to the ray and is the energy fallen onto the flake. Then, rh (J ) is Fresnel reflectance for a ray that runs into a layer with relative refractive index h at the angle of incidence (outside the layer) J .

    d) Add energy of this sparkle to the cumulate energy, and come to the next sparkle.

    5) The visible luminance of the sparkling pixel is related to the solid angle corresponding to the size of observer and the area of the minimal visible element, i.e. the pixel (not to the area of the flake which is always beyond the observer’s resolution!):

    where k is the attenuation factor for the ray running from intersection point to the observer; is the angular size of the LS as seen from the environment (=outside the paint). The first denominator gives the solid angle in which the sparkle’s energy that reaches observer is emitted, and the second gives its visible area.

    REMARK. Maybe, it is reasonable to ascribe to the pixel the greatest among the diffuse luminance, highlight and sparkle luminance. Otherwise it may occur that in the highlighted area, sparkles will be dark points!

    REMARK. In case when the scene is not in vacuum, it may prove necessary to take into account attenuation of light on its way from light source to the sparkle and from the sparkle to the observer.

    6. Acknowledgements

    We are grateful to Prof. Yu. M. Bayakovskii for useful discussions.

    7. References

    1. C.S.McCarny. Observation and measurement of the appearance of metallic materials. Part II. Micro appearance. Color research and application (1998) 23(6), 362-373.

    2. J.S. Gondek, G.W. Meyer, and J.G. Newman, Wavelength dependent reflectance functions, Proceedings SIGGRAPH 94, in Computer Graphics, Annual Conference Series, 1994 213-220.

    3. D.J. Heeger, J.R. Bergen. Pyramid-based texture analysis/synthesis, Proceedings SIGGRAPH 95, in Computer Graphics, Annual Conference Series, 1995 229–238.


    Computer Graphics & Geometry