Natural optical vignetting
Why an ideal lens delivers less irradiance at oblique field angles — and how to apply the photometric law in linear light.
Visible effect
A smooth exposure gradient from centre to corner
Start with a uniformly exposed surface or a regular grid.
The centre remains the reference brightness while the image darkens gradually toward the corners. There is no hard boundary, clipped shape, or sudden shadow: the change follows field angle.
Physics
Oblique image points receive less irradiance
Even an unobstructed ideal imaging system does not illuminate every field angle equally. Away from the optical axis, the pupil is seen obliquely, the same flux is distributed by different solid-angle geometry, and the image plane itself is tilted relative to the arriving bundle. In the idealised thin-lens model, those factors combine into the cos⁴ lawAn idealized optical falloff in which off-axis image illumination decreases approximately with the fourth power of the ray-angle cosine..
Mathematics
Field angle determines relative irradiance
Let the image plane use half-frame-height units, so its vertical edge is at radius one. The focal distance associated with a vertical field of view is therefore 1 / tan(FOVy / 2):
The aspect ratio scales the horizontal coordinate before computing radius. The physical curve reaches one at the optical centre and decreases monotonically with field angle. The optional floor and gain in the playground are compensation controls, not additional optical laws.
Shader
GLSL irradiance multiplier
The playground compiles the same attenuation function shown below. The surrounding fragment shader decodes the sampled sRGB value, multiplies in linear light, and encodes the result again.
// WHAT: Compute the natural cos^4 illumination falloff of an image plane.
// HOW: Convert the pixel to an aspect-correct image-plane radius, recover
// cos^2(theta) from focal distance, then square it to obtain cos^4(theta).
// WHY: This changes light level without warping coordinates or accumulating
// history, matching the geometric form of natural optical vignetting.
float cos4Attenuation(
vec2 destinationUv01,
vec2 centerUv01,
float aspect,
float focalDistance,
float minimumTransmission,
float gain
) {
// Center and aspect correction make radius independent of output shape.
vec2 imagePosition = (destinationUv01 - centerUv01) * 2.0;
imagePosition.x *= aspect;
float radiusSquared = dot(imagePosition, imagePosition);
float focalDistanceSquared = focalDistance * focalDistance;
float cosineSquared =
focalDistanceSquared / (focalDistanceSquared + radiusSquared);
float physicalFalloff = cosineSquared * cosineSquared;
// minimumTransmission is an artistic floor; gain exposes overall compensation.
return mix(minimumTransmission, 1.0, physicalFalloff) * gain;
}- Source texturesRGB
- Illumination falloffOne fullscreen render pass
- Decode to linear light
- Apply the cos⁴ multiplier
- Encode to sRGB
- Display output
Why these steps are here
- Use image-plane coordinates. UV is centred, doubled into half-height units, and aspect-corrected before radius is measured.
- Avoid an angle function. Computing
f² / (f² + r²)gives cos² directly; squaring once more gives cos⁴ withoutatanorcos. - Separate physics from compensation. Floor lifts the darkest field values and gain changes overall exposure after the physical curve is evaluated.
- Work in linear light. Multiplying gamma-encoded display values would produce the wrong photometric response.
One texture read per pixel; no coordinate warp and no history buffer.
Notes
- Real objectives can depart substantially from cos⁴ through pupil magnification, retrofocus or telecentric design, sensor microlenses, and optical correction.
- The effect changes irradiance, not geometry; straight lines remain straight and texture coordinates do not move.
- The centre control represents a displaced optical axis, while the viewport itself remains unchanged.
- Exposure compensation can lift the corners, but it also amplifies noise already present there.
References
Edmund Optics — Relative illumination, roll-off, and vignetting — separates natural illumination roll-off from mechanical ray clipping.