Panini Projection

3D projection that fixes the perspective projection's geometric distortion on sides of the view having a wide FOV.

Choose your operating system:

Windows

macOS

Linux

Configuration

By default, Unreal Engine 4 is using a perspective projection. However this projection model create distortions of the geometry when working with a wide field of view. It is very noticeable for instance here with sphere and a FOV = 120.

qagame_fov120.png

Therefore Unreal Engine provides a optional post processing pass that attempt to fix this issue using a Panini

  1. The idea of this post processing is to displaced the rendered pixel at the location where they should using the panini projection instead of the perspective projection. To set up, the only thing you need to do is setting up r.Upscale.Panini.D > 0. This post process effect is done in the Upscaling pass. It means this pass is then going to be used if r.ScreenPercentage != 100 or r.Upscale.Panini.D > 0. For further understanding of this parameter, you can refer directly to the original research paper referenced at the bottom of this page.

qagame_fov120_panini.png

r.Upscale.Panini.D > 0 directly emphasizes the effect. However it is not the only parameter. r.Upscale.Panini.S lerp with the paper's hardcompression. And if still some sphere still looks eclipsed in the corners, then this parameter can also be tweaked as well. However, for r.Upscale.Panini.S < 0 , start shows unrendered black looking pixels in the corners.

qagame_fov120_vertical_compression.png

To have more understanding of how this effect works, r.Upscale.ScreenFit can be modified as well. One thing to have in mind is that some of the perspective projected pixels are at the end being not show at the screen near the top and bottom of the screen.

qagame_actual_effect.png

Straight lines

The panini projection brings several guarantees on the lines. Firstly the vertical lines are guaranteed to stay straight for any r.Upscale.Panini.D and r.Upscale.Panini.S. Secondly, the lines going through the center of the screen is guaranteed to stay straight as well for any r.Upscale.Panini.D , but r.Upscale.Panini.S = 0 . This mathematical property is therefore ideal in First-Person-Shooter game because the panini projection of a weapon directed towards the center of the screen is going to keep its straight lines going towards the center.

shootergame_fov120.png shootergame_fov120_panini.png

Center Bluriness

One issue of this post processing effect is that a blur phenomena at the center of the screen kicks in as r.Upscale.Panini.D increase. The panini projection has been implemented in the upscale pass especially to take advantage of the sharpening filter to fight against this phenomena. However it can quickly become not enough to fix this issue. Therefore you may need to increase r.ScreenPercentage to help fixing that issue but that is going to have a cost on all your rendering performance because increasing the number of pixels to draw. You may consider choosing a better trade of by then choosing a lower value of r.Upscale.Panini.D on hardware that can't afford an higher screen percentage, and still have this effect by only relying on the upscale pass's sharpening filter.

shootergame_fov120_panini_screen_percentage.png

Another way to use the panini projection is through a Material function outputting a world position offset to be plugged-in into the material's world position offset input pin. This actually what Unreal Tournament uses instead of rendering the weapon at a different FOV to fix the perspective projection

  1. You may want to have a look at it in the UT's github repository.

References

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss