Orthographic camera projection in UE4

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?

Orthographic camera

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:

The gif is showing how small field of view makes the projection almost similar to orthographic projection.
At the field of view close to 0 degrees, it almost looks like an orthographic camera in UE4.

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:

Same 2d platformer but with perspective camera mode on. It makes it look almost like an orthographic camera.

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:

from perspective mode to an almost orthographic camera view

2 thoughts on “Orthographic camera projection in UE4

    1. Hi Flynn,
      I haven’t faced a problem similar to what you described.
      But here is my guess:
      1. Try to decrease FOV. Check how, for instance, 5 or 10 degrees work. Or maybe decrease the focal length – UE4 might experience issues handling mouse events for really small objects, who knows. Anyway, play with the parameters and see how it works. BTW, post a screenshot in your answerhub question – this may help.
      2. As for the visuals – I got something similar – my post-process effects did not work. Turned out that, the camera was out of bounds of Post Process volume. Check that all your volumes are in correct places.

Leave a Reply

Your email address will not be published.