Film dust and dirt
How particles on or close to film form compact, frame-bound silhouettes whose sharpness and displayed polarity reveal where and when contamination entered the photochemical chain.
Visible effect
Small silhouettes stay with the film frame
Film dust appears as compact flecks, dots, fibres, and irregular blobs that sit in image coordinates rather than belonging to photographed objects. A particle may hold for several frames, jump when the film advances, or disappear when the transport or cleaning system dislodges it.
Dust close to the emulsion casts a compact shadow, but the final sign depends on when it blocks light. Shielding a camera negative during exposure usually leaves a dark mark in the positive image. Dirt on a developed negative during printing or scanning can instead become a light mark after inversion. Opaque dirt on a projected positive blocks screen light and appears dark.
Physics
Particle distance controls edge sharpness
Dust can enter while film is loaded, travel through a dirty gate or magazine, settle during printing, or be carried between generations. A particle lying on the emulsion blocks incident light over almost its own outline. Lift it away from the image plane and rays pass around its edge, creating a larger, softer penumbra.
Displayed tone records the contamination stage. Dust shielding a camera negative during exposure leaves low negative density: positive printing or digital inversion renders that area dark. Dirt lying on the developed negative during printing blocks exposure of the positive and leaves a light speck; transmitted-light scanning followed by inversion gives the same sign. Dirt on a projected positive instead blocks projection light and appears dark. The model's light/dark control selects the final transferred appearance rather than inferring a stage from particle shape.
The linear-light explanation distinguishes encoded RGB from light-proportional values. This pass uses a 2.2 power-law decoding/encoding approximation, rather than the exact piecewise sRGB transfer function.
The film-camera mechanism locates possible contamination along the transport path. The negative-to-positive explanation traces how an obstruction at exposure or reproduction can change the displayed sign.
Mathematics
Irregular radial masks with controlled feathering
Each particle has centre cᵢ, nominal radius r̄ᵢ, and a low-order angular perturbation that keeps the silhouette from becoming a perfect disk. Feather width fᵢ models the penumbra. Separate sets P+ and P− retain transfer polarity.
The maximum combines overlaps without accumulating opacity by loop order. Strength k composites the masks in linear light. A held integer state changes the particle layout at film-like intervals rather than every display refresh.
Shader
A bounded bank of frame-held particle silhouettes
The shader uses twenty-eight bounded particle slots with irregular radial edges, exposing size, softness, persistence, and transfer polarity independently.
// WHAT: Generate sharp, irregular dust silhouettes attached to the film frame.
// HOW: Create a bounded set of deterministic particles, vary each elliptical
// edge with angular waves, and combine separate light and dark damage masks.
// WHY: Dust close to film casts a particle-shaped mark in film coordinates;
// a broad optical blur or continuously drifting screen-space noise is different.
// A small deterministic hash turns one particle number into repeatable [0, 1]
// choices. Its constants are decorrelation values, not physical dust parameters.
float dustHash(float value) {
return fract(sin(value * 127.1) * 43758.5453123);
}
// The returned vec2 contains two masks:
// masks.x = light/clear dust marks
// masks.y = dark/opaque dust marks
vec2 filmDustMasks(
vec2 uv,
float time,
float amount,
float size,
float softness,
float hold,
float seed,
float polarity
) {
vec2 masks = vec2(0.0);
// Hold one particle layout for a finite interval, then choose a new state.
float layoutState = floor(max(time, 0.0) / max(hold, 0.05));
// Evaluate at most 28 possible particles. amount controls how many are active.
for (int index = 0; index < 28; index += 1) {
float particleId = float(index) + floor(seed) + layoutState * 31.7;
float enabled = step(
1.0 - clamp(amount, 0.0, 1.0) * 0.72,
dustHash(particleId * 2.1)
);
vec2 centre = vec2(
dustHash(particleId * 3.7),
dustHash(particleId * 5.9)
);
vec2 fromCentre = uv - centre;
// Stretch x differently per particle so the population is not all circular.
fromCentre.x *= 1.0 + 1.8 * dustHash(particleId * 7.3);
float angle = atan(fromCentre.y, fromCentre.x);
// Two angular harmonics roughen the otherwise smooth ellipse boundary.
float irregularEdge = 1.0
+ 0.2 * sin(angle * 3.0 + particleId)
+ 0.12 * sin(angle * 7.0 - particleId);
float baseRadius = mix(0.003, 0.026, clamp(size, 0.0, 1.0));
float radiusVariation = mix(
0.55,
1.35,
dustHash(particleId * 11.1)
);
float radius = baseRadius * radiusVariation * irregularEdge;
float feather = mix(
0.0004,
radius * 0.65,
clamp(softness, 0.0, 1.0)
);
float particleMask = enabled * (
1.0 - smoothstep(
radius - feather,
radius + feather,
length(fromCentre)
)
);
// polarity > 0 selects light marks, < 0 dark marks, and 0 mixes both.
float lightParticle = polarity > 0.5
? 1.0
: (polarity < -0.5 ? 0.0 : step(0.5, dustHash(particleId * 17.7)));
masks.x = max(masks.x, particleMask * lightParticle);
masks.y = max(masks.y, particleMask * (1.0 - lightParticle));
}
return clamp(masks, 0.0, 1.0);
}
vec3 applyFilmDust(vec3 sourceSrgb, vec2 masks, float strength) {
// Add/remove light in a linear-light approximation, then encode for display.
vec3 sourceLinear = pow(max(sourceSrgb, vec3(0.0)), vec3(2.2));
float safeStrength = clamp(strength, 0.0, 1.0);
vec3 withLightMarks = mix(
sourceLinear,
vec3(1.0),
masks.x * safeStrength
);
vec3 damaged = withLightMarks * (1.0 - masks.y * safeStrength);
return pow(max(damaged, vec3(0.0)), vec3(1.0 / 2.2));
}- Source texturesRGB · one texture read per pixel
- Frame-held particle compositeOne fullscreen render pass
- Aspect-fill sample
- Generate bounded irregular particle silhouettes
- Hold the contamination state across film intervals
- Split light and dark transfer polarities
- Composite contamination in linear light
- Encode to sRGB
- Display output
Why these steps are here
- Place particles in frame space. Marks should not follow photographed objects or camera motion.
- Perturb the radial edge. A few harmonics make fibres and grit less geometrically perfect.
- Hold the random state. Dirt persists until transport or cleaning moves it.
- Split transfer polarity. Geometry and generation history remain separate controls.
- Composite in linear light. Dark blockage and light transferred marks remain bounded.
Notes
- Use the Source selector to test dust against footage, still images, or the diagnostic grid; edge visibility depends strongly on local contrast.
- The procedural particles are useful for live rendering. Scanned mattes are better when matching a particular film element or restoration reference.
- Dust on a scanner or digital sensor can also be image-bound, but its geometry and temporal behaviour follow a different acquisition path.
- Restoration benefits from temporal evidence: real film dust may disappear abruptly between frames while scene detail moves coherently.
References
Kodak — Handling of Processed Film — manufacturer guidance on dust, abrasion, longitudinal scratches, dirty rollers, cleaning, and storage.
Kodak — Processing Motion Picture Films, Module 15, pp. 15-22 and 15-29 — distinguishes light specks transferred from dirt on a negative from dark specks on a projected reversal original; exposure-time shielding and reproduction-time obstruction must be tracked separately.