- Common.ush change of runtime check for IsOrthoProjection() function calls to minimise cost to 1ALU
- Add 2 new functions, ScreenVectorFromScreenRect and GetScreenPositionForProjectionMatrix which return corrected values depending on projection type
- Converted CommonViewUniformBuffer to read from the new ViewUniformBuffer TanAndInvTanHalfFOV vector. This means that the static projection matrix values used by these functions are assigned in SceneView.cpp. Ortho rendering does not use these values, so these functions only need to return 1.0f for each value for ortho, and moving this to a constant vector means we avoid unnecessary IsOrthoProjection checks in the shader code.
- Added a few helper functions for the above to SceneView.h/.cpp, including a correction for the ScreenToClip matrix which is now reused in multiple locations, including for shadow rendering, rather than being hard coded.
- Utilised these changes to correct the problems with Point and Spot lights+shadows in ortho perspective, and also corrects some minor artifacts that occur with directional light in ortho.
#jira UE-40089
#rb Jason.Hoerner, Jason.Nadro
#preflight 6408c712b0544ef0b4afc961
#fyi Guillaume.Abadie
[CL 24634679 by Jon Cain in ue5-main branch]