1
\$\begingroup\$

I want to make a game with an oblique frustum instead of a standard frustum.

Unity camera has lens shift option for an oblique frustum.

enter image description here

But UE5 does not have such thing.

In this Unity document, I can find the exact way to calculate projection matrix for lens shifting.

using UnityEngine;
using System.Collections;

public class ExampleScript : MonoBehaviour {
    void SetObliqueness(float horizObl, float vertObl) {
        Matrix4x4 mat  = Camera.main.projectionMatrix;
        mat[0, 2] = horizObl;
        mat[1, 2] = vertObl;
        Camera.main.projectionMatrix = mat;
    }
}

But I don't know how to implement a CameraWithLensShift in UE5.

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .