In some games or game genres, a typical 3d perspective camera projection does not really work. For example, classic 2d platformers (2d by definition does not have a perspective) or top-down shooters. And since UE4 is a 3D engine in the first place, one gets a question: how to implement an orthographic camera in UE4?
Fortunately, Unreal Engine has an option for such camera mode. You can enable it in Camera Settings for a Camera Actor:
Perspective camera with narrow FOV
But what if that for some reason does not work for you? Say, you have a lot of post-process effects in your game like using Custom Depth buffer, for example. Unfortunately, this and many other visual features won’t work in orthographic mode. Epic has a filed feature request but I am not sure if they even are gonna work on it in the nearest future.
But thanks to Photography science, you may fake an orthographic camera projection. I don’t want to go into details – you better read it on your own: https://en.wikipedia.org/wiki/Focal_length, read the section “Photography”. I do really like the gif showing how a change in the focal length makes the projection look more orthographic:
It is pretty easy to do the same trick in UE4. Go to Camera Settings of the Camera Actor and adjust FOV value to your preference. And don’t forget to increase (significantly) the distance between your level and the camera.
I applied this to the same scene which I used for the orthographic camera at the beginning of the post and see how it looks really good:
A major advantage of such mode, in my opinion, is that the long focal length and narrow field of view, in the end, is a real projection unlike artificial orthographic. Hence, post-process and other visual effects work perfectly fine.
And instead of a summary, I made a gif visualizing how perspective depends on FOV and Focal Length: