Home Game Development c++ – How so as to add indirect frustum (lens shift) to UE5 digicam?

c++ – How so as to add indirect frustum (lens shift) to UE5 digicam?

0
c++ – How so as to add indirect frustum (lens shift) to UE5 digicam?

[ad_1]

I wish to make a recreation with an indirect frustum as an alternative of an ordinary frustum.

Unity digicam has lens shift choice for an indirect frustum.

enter image description here

But UE5 doesn’t have such factor.

In this Unity doc, I can discover the precise strategy to calculate projection matrix for lens shifting.

utilizing UnityEngine;
utilizing System.Collections;

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

But I do not know how you can implement a CameraWithLensShift in UE5.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here