Missing shadows when using a custom oblique projection matrix
I'm trying to use an oblique top-down perspective, and I achieved this by setting a custom projection matrix script on an orthographic camera:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class CameraOblique : MonoBehaviour
{
void Start()
{
Matrix4x4 mat = Camera.main.projectionMatrix;
mat[0, 2] = 0.0f;
mat[1, 2] = 0.1f;
Camera.main.projectionMatrix = mat;
}
}
The perspective comes out how I'm expecting. However, it seems like shadows are being rendered/culled based on whether it would be in the camera's view without the script on.
Pictures with script off:
Pictures with script on:
Notice how the black capsule does not have a shadow in the second picture. It is outside of what was originally viewable by the camera.
Is there any way to fix this so that unity treats everything in view of the oblique camera as, well, in view?
Alternatively, a way of doing the top-down oblique perspective which doesn't change what parts of the floor are visible.
Your answer
Follow this Question
Related Questions
How to render perspective corrected surface direction? 0 Answers
Projecting part of a unity camera onto a monitor,Projecting certain area of a camera from plane 0 Answers
ScreenToWorldPoint() not working properly using a RenderTexture 1 Answer
ARKit plugin camera modifications 2 Answers
HOW TO - Camera Viewport Rotate OR Mask OR Transparent? 0 Answers