# Modelling

## Examples of Micromodelling

#### Human skin

• skin structure
• keratin, melanin, blood in different proportions
• place to place on the body
• person to person
• time to time
• We could let the rays go through the skin and interact with the pigments,

or we could summarize everything in a parametrized reflectance function

• R(x, \lambda) = R(k(x), m(x), b(x), \lambda)
• How do we calculate? Kubelka-Munk model:
• From the 1930s
• Assume pigment particles are distributed in thin layers
• Do Fresnel refraction at layer interfaces
• Conserve energy at boundaries
• Let layer thickness go to zero
1. Humans are very sensitive to skin colour
2. Two orders of calculation (Spectral distribution for colour, spectral distribution for light, RGB for monitor)
• Light using spectral distribution, then reduce to RGB
• Reduce to RGB, then light
3. Reduce to RGB is a many-to-one transformation: information is lost
• Two calculations don't commute, are not the same
• Problem is metamerism', which is
• Surfaces that match in colour under one illuminant don't necessarily match in colour under another.
• Clothes, fillings in teeth

Cars under sodium vapour light

Obviously the second strategy is better,

• but only if it works
• Select a model, work out a reflectance function, check that it agrees with reality

Note two different definitions of agrees with reality'.

#### Newly cut grass

• What does grass look like?
1. Mowing, with the cutting mower, lines up the blades
• Absorbed light is green and goes all directions
• Reflected light goes mostly in one direction
3. Draw the BRDF
• Calculate the BRDF
• or measure the BRDF
• or schematically estimate the BRDF

Parametrize the BRDF

if it's possible

#### Surface of CD

Close together linear scatterers

• that retain coherence

Calculate interference

• Incorporate in a BRDF

## Particle Systems

What are they?

1. Collections of particles that taken together represent something
• plants like grasses
• hair or fur
• fire
• splashing water
• etc.
2. Each particle has
1. an initial state
• position
• velocity
• size
• colour and/or luminosity
• etc
2. an update function
• changes the state
• can have random perturbations
3. Dynamics has
• transient properties

How to use them for animation.

1. Something starts emitting particles at time t0
2. At each subsequent time step
1. Existing particles are updated
3. New particles are created
4. All particles are rendered.
3. Until all particles are dead (for animation).
• OR, until it reaches a state you like (for static object)
• then grab it as a model

How to use them for visualization.

1. Example. For visualizing motion in a fluid
2. Let them be carried by the fluid
3. Until the fluid flows out of the scene.

How to use them for ray-tracing.

Two ways

1. Let the particle system get into a steady state, then freeze and put into the scene.
• fire, cloud
2. Accumulate the path of each particle, then use it as the shape of a linear primitive
• hair, fur, grass

## Fractal Terrain Generation

What is it?

• A way of getting not-too-regular, not-too-random terrain,
• without positioning every vertex yourself.

How is it done?

• height at each vertex is average height + h(n) with n = 1
• h(n) is a random function with expectation zero
2. Divide each edge in two by positioning a new vertex in its middle.
• new vertex height is average edge height + h(n = n+1)
• magnitude of h(n) probably decreases with n
4. Iterate to 2 until it's good enough.

Tricks.

1. Gets expensive fast. Do as few iterations as possible.
2. Don't look directly down on it. Why?
3. h(n) will need extensive tweaking. Don't get discouraged if you don't get the results you want right away.
4. You could do the first few iterations by hand to control the large-scale result.

What is it good for?

1. Mountains
2. Rolling hills
3. Sand dunes. You will want h(n) to depend on the direction of the edge.
4. etc.