Ok, as some users have been having this issue, I thought I'd give it a go and I think a found a solution.
If you have an orthographic camera, all is good:
Now, if you use perspective, then this weirdness will happen:
After some fiddling, here's my fix, on perspective mode:
So, what changed? Basically, after dumping some values, I noticed the values for _originalCamera.projectionMatrix had a very noticeable difference between two camera modes. Like, in ortho you have tiny values like 0.09, while in perspective, this number was the same, but with less zeros (ie 0.9), so I kinda added this zero back, and all is good.
Ok, as some users have been having this issue, I thought I'd give it a go and I think a found a solution.
If you have an orthographic camera, all is good:
Now, if you use perspective, then this weirdness will happen:
After some fiddling, here's my fix, on perspective mode:
So, what changed? Basically, after dumping some values, I noticed the values for
_originalCamera.projectionMatrix
had a very noticeable difference between two camera modes. Like, in ortho you have tiny values like0.09
, while in perspective, this number was the same, but with less zeros (ie0.9
), so I kinda added this zero back, and all is good.Basically the fix would be replacing this line:
cmd.SetGlobalVector(ShaderIds.CameraPositionDelta, screenDelta * 0.5f);
... for this one:
cmd.SetGlobalVector(ShaderIds.CameraPositionDelta, screenDelta * 0.05f);
I tested different camera Z positions, FOV values and all seem to be working fine, but needs more testing.
If anyone is happy to further test or have the definitive fix, feel free to contribute. Hope this is useful for someone as it is for me!