Panini projection is a cylindrical-perspective family used for wide-FOV images. Compared with rectilinear projection, it reduces edge stretching while keeping vertical lines visually stable, which is useful for architecture and first-person wide-angle views.
This demo renders a standard perspective scene to a texture, then applies Panini in a fullscreen post shader using inverse mapping. The D slider controls projection strength.
Giovanni Paolo Pannini (1691-1765) was an Italian painter known for architectural vedute and large interior scenes with very wide perspective space. Modern Panini projection techniques are a computational rediscovery/formalization of related wide-view perspective practices associated with that tradition.
The fragment shader applies an inverse Panini mapping from
output normalized coordinates (u,v) to source
perspective coordinates:
Then (x,y) is normalized by
tanHalfFovX/tanHalfFovY and sampled
from the source render target.