Quantcast
Channel: Questions in topic: "post processing"
Viewing all articles
Browse latest Browse all 713

Post Processing not working properly with camera transition,

$
0
0
Hello, I have a problem with Post Processing. In my project I have a transition between an orthographic and perspective camera using the following script. It seems to be working, but whenever I am trying to add Post Processing, the whole transition vanishes. I can still see it in the preview window, but not in the actual game view. public static Matrix4x4 MatrixLerp(Matrix4x4 from, Matrix4x4 to, float time) { Matrix4x4 ret = new Matrix4x4(); for (int i = 0; i < 16; i++) ret[i] = Mathf.Lerp(from[i], to[i], time); return ret; } private IEnumerator LerpFromTo(Matrix4x4 src, Matrix4x4 dest, float duration) { float startTime = Time.time; while (Time.time - startTime < duration) { Camera.main.projectionMatrix = MatrixLerp(src, dest, (Time.time - startTime) / duration); yield return 1; } Camera.main.projectionMatrix = dest; } public Coroutine BlendToMatrix(Matrix4x4 targetMatrix, float duration) { StopAllCoroutines(); return StartCoroutine(LerpFromTo(Camera.main.projectionMatrix, targetMatrix, duration)); } ,

Viewing all articles
Browse latest Browse all 713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>