physicalCameraExposure static method
Computes the linear exposure multiplier for a physical pinhole
camera, the way photographers reason about it: aperture (f-stops),
shutterSpeed (seconds), and sensor iso.
Returns 1 / (1.2 * 2^EV100) with
EV100 = log2(aperture^2 / shutterSpeed * 100 / iso), matching
Filament's exposure model. Assign the result to exposure.
Reference values (sunlit exterior): aperture: 16, shutterSpeed: 1/125, iso: 100. Lower the aperture or ISO, or lengthen the
shutter, to brighten.
Implementation
static double physicalCameraExposure({
required double aperture,
required double shutterSpeed,
required double iso,
}) {
final ev100 =
math.log(aperture * aperture / shutterSpeed * 100.0 / iso) / math.ln2;
return 1.0 / (1.2 * math.pow(2.0, ev100));
}