<p>See the paper <a href="http://dx.doi.org/10.1145/344779.344809" rel="nofollow">Computer Modelling of Fallen Snow</a> published in SIGGRAPH 2000:</p>

<blockquote>
  <p>In this paper, we present a new model of snow accumulation and stability for computer graphics. Our contribution is divided into two major components, each essential for modelling the appearance of a thick layer of snowfall on the ground. Our accumulation model determines how much snow a particular surface receives, allowing for such phenomena as flake flutter, flake dusting and wind-blown snow. We compute snow accumulation by shooting particles upwards towards the sky, giving each source surface independent control over its own sampling density, accuracy and computation time. Importance ordering minimises sampling effort while maximising visual information, generating smoothly improving global results that can be interrupted at any point. Once snow lands on the ground, our stability model moves material away from physically unstable areas in a series of small, simultaneous avalanches. We use a simple local stability test that handles very steep surfaces, obstacles, edges, and wind transit. Our stability algorithm also handles other materials, such as flour, sand, and flowing water.</p>
</blockquote>

<p>Its <a href="http://www.cs.ubc.ca/nest/imager/contributions/fearing/snow/snow.html" rel="nofollow">project page</a> contains explanations and example images. A PDF is <a href="https://graphics.stanford.edu/courses/cs448-01-spring/papers/fearing.pdf" rel="nofollow">here</a>.</p>

<p>An older paper is <a href="http://www.cse.cuhk.edu.hk/~ttwong/papers/dust/dust.html" rel="nofollow">Simulating Dust Accumulation</a>, published in <em>IEEE Computer Graphics &amp; Applications</em> in 1995:</p>

<blockquote>
  <p>This paper describes a dust modeling technique. An empirical method is used to visually simulate the effect of dust accumulation on object surfaces. The dust amount is first predicted based on the properties of the surfaces: the surface inclination and stickiness. This predicted amount is then adjusted according to some external factors: surface exposure to wind and scraping off by other objects. The calculated dust amount is finally perturbed by a noise function on rendering to give a fuzzy visual effect.</p>
</blockquote>

CC BY-SA 3.0
2015-08-18T05:30:15.183Z
2015-08-18T18:22:01.660Z
2015-08-18T18:22:01.660Z
lhf
<p>Intuitively, dust settles onto surfaces at a higher rate in areas where the air flow is slower. This means instead of a surface gathering an even layer of dust, there will be more in corners - corners of a room/shelf, corners formed by the placement of objects on a surface, concavities in a surface.</p>

<p>I can get an increase in realism simply by making the thickness/density of dust reduce with distance from an object, and combine that effect for several objects including walls. This naturally gives the expected ordering of thicknesses - the edges of a floor have more dust than the centre, the corners where the edges meet have more dust then the centre of the edges. However, the increase in realism from getting the order correct still leaves the problem of getting the ratio right. There is more dust in the places you expect to have more dust, but not necessarily the right amount more.</p>

<p>Is there an established method of approximating a realistic ratio of thickness between different points on a surface? I don't need this to be completely physically accurate (that would need to take into account objects that move through the environment during the long period taken for dust to accumulate). I'm just looking for average behaviour that will look believable to the human eye.</p>

<p>In searching online I've mostly found atmospheric models for suspended dust, rather than a way of modelling dust deposition on a surface.</p>

<h2>My attempts - linear and exponential distributions</h2>

<p>Here is some code in Python 3 using pillow (the PIL fork) that demonstrates a couple of distributions I have experimented with:</p>

<pre class="lang-python prettyprint-override"><code>from PIL import Image
from math import exp


def linear(distance, scale):
    return max(0, 64 - distance * scale)


def exponential(distance, scale):
    return 64 * exp(-distance * scale)


def exponential_squared(distance, scale):
    return 64 * exp(-distance * distance * scale)


def gamma_corrected(value):
    corrected_value = int((value/255)**(1/2.2)*255)
    return corrected_value


def produce_image(image_size=(1024,1024),
                  glasses=(((100,300),90),((300,300),110)),
                  distribution=exponential,
                  scale=0.1,
                  background_level=0,
                  gamma=2.2,
                  filename='dusttest.png'
                  ):
    width, height = image_size
    pixels = []
    for y in range(height):
        for x in range(width):
            red, green, blue = pixel_value(x, y, image_size, glasses,
                                           distribution, scale,
                                           background_level
                                           )
            pixels.append((red, green, blue))

    image = Image.new('RGB', image_size, color=None)
    image.putdata(pixels)
    image.save(filename)


def pixel_value(x, y, image_size, glasses, distribution, scale,
                background_level
                ):
    width, height = image_size
    value = background_level
    value += distribution(x, scale)
    value += distribution(width-x, scale)
    value += distribution(y, scale)
    for glass in glasses:
        coords, radius = glass
        a, b = coords
        distance = ((x-a) ** 2 + (y-b) ** 2) ** 0.5 - radius
        if distance &lt; 0:
            value = 0
            break
        value += distribution(distance, scale)
    value = 255 - gamma_corrected(value)
    return ((value, value, value))


if __name__ == '__main__':
    for scale in [0.1, 0.2, 0.4, 0.8]:
        produce_image(distribution=linear,
                      scale=scale,
                      background_level=20,
                      filename='linear-' + str(scale) + '-dusttest.png'
                      )
    for scale in [0.1, 0.05, 0.03, 0.01]:
        produce_image(distribution=exponential,
                      scale=scale,
                      background_level=0,
                      filename='exponential-' + str(scale) + '-dusttest.png'
                      )
    for scale in [0.01, 0.001, 0.0001, 0.00001]:
        produce_image(distribution=exponential_squared,
                      scale=scale,
                      background_level=0,
                      filename='exponential-squared-' + str(scale) + '-dusttest.png'
                      )
</code></pre>

<p>Imagine looking down from above on a white shelf that has had drinking glasses placed on it. Some time later the glasses are removed to leave dust free circular regions and a distribution of dust over the rest of the shelf. The dust is affected by the positions of the glasses and the back and side walls. The front of the shelf (bottom of the image) is open, with no wall to increase dust.</p>

<h2>Output</h2>

<p><em>(Click for larger images)</em></p>

<p><strong>Linear reduction in dust density plus constant background level of dust:</strong></p>

<p><a href="https://i.sstatic.net/4FtgD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4FtgDm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/cnyaS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cnyaSm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/RXWlg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RXWlgm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/IgPu0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IgPu0m.png" alt="enter image description here"></a></p>

<p><strong>Exponential reduction in dust density (zero background level):</strong></p>

<p><a href="https://i.sstatic.net/4Td7b.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4Td7bm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/KUdEn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KUdEnm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/hbgk3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hbgk3m.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/X29hi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/X29him.png" alt="enter image description here"></a></p>

<p>I expected the exponential version to be closer to reality, and I prefer the result visually. However, I still don't know if this is close enough.</p>

<p><strong>Following <a href="https://computergraphics.stackexchange.com/users/56/alan-wolfe">Alan Wolfe</a>'s suggestion of the normal distribution, I've also added images using <code>exp(-distance ** 2)</code> at a variety of scales.</strong></p>

<p><a href="https://i.sstatic.net/n1oOr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/n1oOrm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/2SJD9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2SJD9m.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/LVfCg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LVfCgm.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/M0N8o.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M0N8om.png" alt="enter image description here"></a></p>

<p>I quite like this too, but I still couldn't guess which of this and exponential (<code>exp(-distance)</code>) is best.</p>

<p>I'm looking for feedback in two ways:</p>

<ol>
<li>Do any of these distributions look right/natural to you? I want input from a wider range of human eyes, ideally with specific problems/inconsistencies.</li>
<li>Is there a physical interpretation that would justify using one of these distributions, or that would suggest a better one?</li>
</ol>

CC BY-SA 3.0
2015-08-17T17:23:19.647Z
Have you tried the normal distribution (Gaussian function)? It seems that it would help here since it is used to figure out where things will be on average with certain characteristics of probabilities.  Dust settling randomly but less often where there's more airflow and more often in crevices seems right in its wheelhouse.
Alan Wolfe
CC BY-SA 3.0
2015-08-17T18:22:25.437Z
@AlanWolfe thanks for the suggestion - I've added in some more images based on that.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-17T18:38:04.013Z
exponential looks better to me than linear or the normal distribution based one, but i don't have any non opinion answers to back anything up about correctness :P
Alan Wolfe
CC BY-SA 3.0
2015-08-17T18:51:53.140Z
How about a cellular automata of some kind? Diffusion step and then erode diffuse then erode...
joojaa
<distribution>
Is there an established method of approximating dust distribution on surfaces?
trichoplax is on Codidact now
# Is there an established method of approximating dust distribution on surfaces?

(Asked by: username_0 on 2015-08-17)

Intuitively, dust settles onto surfaces at a higher rate in areas where the air flow is slower. This means instead of a surface gathering an even layer of dust, there will be more in corners - corners of a room/shelf, corners formed by the placement of objects on a surface, concavities in a surface.

I can get an increase in realism simply by making the thickness/density of dust reduce with distance from an object, and combine that effect for several objects including walls. This naturally gives the expected ordering of thicknesses - the edges of a floor have more dust than the centre, the corners where the edges meet have more dust then the centre of the edges. However, the increase in realism from getting the order correct still leaves the problem of getting the ratio right. There is more dust in the places you expect to have more dust, but not necessarily the right amount more.

Is there an established method of approximating a realistic ratio of thickness between different points on a surface? I don't need this to be completely physically accurate (that would need to take into account objects that move through the environment during the long period taken for dust to accumulate). I'm just looking for average behaviour that will look believable to the human eye.

In searching online I've mostly found atmospheric models for suspended dust, rather than a way of modelling dust deposition on a surface.

## My attempts - linear and exponential distributions

Here is some code in Python 3 using pillow (the PIL fork) that demonstrates a couple of distributions I have experimented with:

```python
from PIL import Image
from math import exp

def linear(distance, scale):
    return max(0, 64 - distance * scale)

def exponential(distance, scale):
    return 64 * exp(-distance * scale)

def exponential_squared(distance, scale):
    return 64 * exp(-distance * distance * scale)

def gamma_corrected(value):
    corrected_value = int((value/255)**(1/2.2)*255)
    return corrected_value

def produce_image(image_size=(1024,1024),
                  glasses=(((100,300),90),((300,300),110)),
                  distribution=exponential,
                  scale=0.1,
                  background_level=0,
                  gamma=2.2,
                  filename='dusttest.png'
                  ):
    width, height = image_size
    pixels = []
    for y in range(height):
        for x in range(width):
            red, green, blue = pixel_value(x, y, image_size, glasses,
                                           distribution, scale,
                                           background_level
                                           )
            pixels.append((red, green, blue))

    image = Image.new('RGB', image_size, color=None)
    image.putdata(pixels)
    image.save(filename)

def pixel_value(x, y, image_size, glasses, distribution, scale,
                background_level
                ):
    width, height = image_size
    value = background_level
    value += distribution(x, scale)
    value += distribution(width-x, scale)
    value += distribution(y, scale)
    for glass in glasses:
        coords, radius = glass
        a, b = coords
        distance = ((x-a) ** 2 + (y-b) ** 2) ** 0.5 - radius
        if distance < 0:
            value = 0
            break
        value += distribution(distance, scale)
    value = 255 - gamma_corrected(value)
    return ((value, value, value))

if __name__ == '__main__':
    for scale in [0.1, 0.2, 0.4, 0.8]:
        produce_image(distribution=linear,
                      scale=scale,
                      background_level=20,
                      filename='linear-' + str(scale) + '-dusttest.png'
                      )
    for scale in [0.1, 0.05, 0.03, 0.01]:
        produce_image(distribution=exponential,
                      scale=scale,
                      background_level=0,
                      filename='exponential-' + str(scale) + '-dusttest.png'
                      )
    for scale in [0.01, 0.001, 0.0001, 0.00001]:
        produce_image(distribution=exponential_squared,
                      scale=scale,
                      background_level=0,
                      filename='exponential-squared-' + str(scale) + '-dusttest.png'
                      )

```

Imagine looking down from above on a white shelf that has had drinking glasses placed on it. Some time later the glasses are removed to leave dust free circular regions and a distribution of dust over the rest of the shelf. The dust is affected by the positions of the glasses and the back and side walls. The front of the shelf (bottom of the image) is open, with no wall to increase dust.

## Output

*(Click for larger images)*

**Linear reduction in dust density plus constant background level of dust:**

[![enter image description here](https://i.sstatic.net/4FtgDm.png)](https://i.sstatic.net/4FtgD.png)
[![enter image description here](https://i.sstatic.net/cnyaSm.png)](https://i.sstatic.net/cnyaS.png)
[![enter image description here](https://i.sstatic.net/RXWlgm.png)](https://i.sstatic.net/RXWlg.png)
[![enter image description here](https://i.sstatic.net/IgPu0m.png)](https://i.sstatic.net/IgPu0.png)

**Exponential reduction in dust density (zero background level):**

[![enter image description here](https://i.sstatic.net/4Td7bm.png)](https://i.sstatic.net/4Td7b.png)
[![enter image description here](https://i.sstatic.net/KUdEnm.png)](https://i.sstatic.net/KUdEn.png)
[![enter image description here](https://i.sstatic.net/hbgk3m.png)](https://i.sstatic.net/hbgk3.png)
[![enter image description here](https://i.sstatic.net/X29him.png)](https://i.sstatic.net/X29hi.png)

I expected the exponential version to be closer to reality, and I prefer the result visually. However, I still don't know if this is close enough.

**Following [username_1 username_1](https://computergraphics.stackexchange.com/users/56/username_1)'s suggestion of the normal distribution, I've also added images using `exp(-distance ** 2)` at a variety of scales.**

[![enter image description here](https://i.sstatic.net/n1oOrm.png)](https://i.sstatic.net/n1oOr.png)
[![enter image description here](https://i.sstatic.net/2SJD9m.png)](https://i.sstatic.net/2SJD9.png)
[![enter image description here](https://i.sstatic.net/LVfCgm.png)](https://i.sstatic.net/LVfCg.png)
[![enter image description here](https://i.sstatic.net/M0N8om.png)](https://i.sstatic.net/M0N8o.png)

I quite like this too, but I still couldn't guess which of this and exponential (`exp(-distance)`) is best.

I'm looking for feedback in two ways:

1. Do any of these distributions look right/natural to you? I want input from a wider range of human eyes, ideally with specific problems/inconsistencies.
2. Is there a physical interpretation that would justify using one of these distributions, or that would suggest a better one?

**Tags:** distribution

> **Comments:**
> **username_1**: Have you tried the normal distribution (Gaussian function)? It seems that it would help here since it is used to figure out where things will be on average with certain characteristics of probabilities.  Dust settling randomly but less often where there's more airflow and more often in crevices seems right in its wheelhouse.  
> **username_0**: @username_1 thanks for the suggestion - I've added in some more images based on that.  
> **username_1**: exponential looks better to me than linear or the normal distribution based one, but i don't have any non opinion answers to back anything up about correctness :P  
> **username_2**: How about a cellular automata of some kind? Diffusion step and then erode diffuse then erode...  

---

## 1 answers

### Answer by username_3 on 2015-08-18. Score: 2

See the paper [Computer Modelling of Fallen Snow](http://dx.doi.org/10.1145/344779.344809) published in SIGGRAPH 2000:

> In this paper, we present a new model of snow accumulation and stability for computer graphics. Our contribution is divided into two major components, each essential for modelling the appearance of a thick layer of snowfall on the ground. Our accumulation model determines how much snow a particular surface receives, allowing for such phenomena as flake flutter, flake dusting and wind-blown snow. We compute snow accumulation by shooting particles upwards towards the sky, giving each source surface independent control over its own sampling density, accuracy and computation time. Importance ordering minimises sampling effort while maximising visual information, generating smoothly improving global results that can be interrupted at any point. Once snow lands on the ground, our stability model moves material away from physically unstable areas in a series of small, simultaneous avalanches. We use a simple local stability test that handles very steep surfaces, obstacles, edges, and wind transit. Our stability algorithm also handles other materials, such as flour, sand, and flowing water.

Its [project page](http://www.cs.ubc.ca/nest/imager/contributions/fearing/snow/snow.html) contains explanations and example images. A PDF is [here](https://graphics.stanford.edu/courses/cs448-01-spring/papers/fearing.pdf).

An older paper is [Simulating Dust Accumulation](http://www.cse.cuhk.edu.hk/~ttwong/papers/dust/dust.html), published in *IEEE Computer Graphics & Applications* in 1995:

> This paper describes a dust modeling technique. An empirical method is used to visually simulate the effect of dust accumulation on object surfaces. The dust amount is first predicted based on the properties of the surfaces: the surface inclination and stickiness. This predicted amount is then adjusted according to some external factors: surface exposure to wind and scraping off by other objects. The calculated dust amount is finally perturbed by a noise function on rendering to give a fuzzy visual effect.


---

