[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.
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]