I am trying to use nDisplay to simulate 4 windows of a transportation vehicle. There’s a front, back, and 2 left windows (next to each other like a limo). I cannot seem to set the 2 left windows as orthographic cameras when using nDisplay’s Projection Policy API - setcamera. It either displays 1 black camera or defaults to a perspective camera. I need orhto in order to not have the cameras overlap in what they see.
I read there are some issues with Ortho cameras already and wondering if it is related.
Any help would be appreciated. Thank you!
While nDisplay does not support ortho cameras out of the box, there are some ways to implement it.
nDisplay generates an assymetric frustum defined by the screen dimensions AND eye point position. That volume creates a frustum.
Two points:
We allow people to specify their own Projection Policy to “manual” meaning they “could” in theory set ortho projection matrices in there ( see Projection Policies in nDisplay )
One could very well emulate orthographic projection with a very far eye point. Maybe not 100% mathematically correct but you could reach pretty close that it would be undistinguishable
Note: Something to be aware about when approaching orthographic projections - lots of engine features tend to break or not work well with orthographic projections or projection matrices reaching orthographic shapes.
Just in case someone wants to do ortho projection with ndisplay, I found the “manual” projection policy was not enough in my case, only allowing to set the frustrum but not really setting the viewport as ortho.
To get an ortho view for your VP:
First step is to head to your ndisplay config file, select the viewport you want ortho. In the details panel select “Manual” for projection policy. Then immediately after, select “Custom”.
(Selecting Manual first and then Custom allows Unreal to fill in the required parameters).
Next step is to fill in the matrix.
I found the matrix to be slightly different in Unreal than in WebGL or Unity, so you can use the function “Calculate Projection Matrix” from any Blueprint to get your projection matrix. You can split the input structure to get all the parameters you need, and you can simply print the output to the console.
The output of that function will give you the Matrix you need.
I’ve found that for viewports to refresh their view in the ndisplay editor, I have to compile and close the tab and reopen the config.
After reopening, your VP should show an ortho view with your parameters.