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.
![](https://d1iv7db44yhgxn.cloudfront.net/documentation/images/dba6ef8d-ed3f-490e-9490-732e37160007/qagame_fov120.png)
Therefore Unreal Engine provides a optional post processing pass that attempt to fix this issue using a Panini Projection. 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.
![](https://d1iv7db44yhgxn.cloudfront.net/documentation/images/2f666849-23e2-422d-91e1-dd5fb74b6f11/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.
![](https://d1iv7db44yhgxn.cloudfront.net/documentation/images/b532f3a7-2946-455f-8d84-3d2acb9f155f/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.
![](https://d1iv7db44yhgxn.cloudfront.net/documentation/images/e0107fe5-4301-44f1-92d3-dbf3716c8acd/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.
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.
![](https://d1iv7db44yhgxn.cloudfront.net/documentation/images/676725cd-c192-4bea-9a77-129433da0cfd/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 distortions. You may want to have a look at it in the UT's github repository.