fisheyeDistortion
The second coefficient for determining the radial distortion applied to pixels rendered using the camera.
Declaration
var fisheyeDistortion: Float { get set }Discussion
Light passing through any lens produces some amount of radial distortion, which a renderer can compute based on the focalLength property. However, some lenses or aesthetic designs introduce additional distortion. A renderer can model radial distortion using the following equation, in which r is the radial distance from a pixel to be rendered to the center of the projection, and r’ is the new radial distance to that pixel accounting for distortion:
r' = r * (1 + barrelDistortion * r^2 + fisheyeDistortion * r^4)
A nonzero barrelDistortion value sufficiently describes the distortion characteristic of most lenses. To simulate other lenses—such as security cameras, plastic toy lenses, or VR headsets—use both the barrelDistortion and fisheyeDistortion properties. The default value of both radial distortion parameters is zero, resulting in a rectilinear projection.