public Matrix4x4 GetJitteredProjectionMatrix(Camera camera, ref Vector2 jitter) { Matrix4x4 cameraProj; jitter = GenerateRandomOffset(); jitter *= jitterSpread; cameraProj = camera.orthographic ? RuntimeUtilities.GetJitteredOrthographicProjectionMatrix(camera, jitter) : RuntimeUtilities.GetJitteredPerspectiveProjectionMatrix(camera, jitter); jitter = new Vector2(jitter.x / camera.pixelWidth, jitter.y / camera.pixelHeight); return(cameraProj); }
/// <summary> /// Generates a jittered projection matrix for a given camera. /// </summary> /// <param name="camera">The camera to get a jittered projection matrix for.</param> /// <returns>A jittered projection matrix.</returns> public Matrix4x4 GetJitteredProjectionMatrix(Camera camera) { Matrix4x4 cameraProj; jitter = GenerateRandomOffset(); if (jitteredMatrixFunc != null) { cameraProj = jitteredMatrixFunc(camera, jitter); } else { cameraProj = camera.orthographic ? RuntimeUtilities.GetJitteredOrthographicProjectionMatrix(camera, jitter) : RuntimeUtilities.GetJitteredPerspectiveProjectionMatrix(camera, jitter); } jitter = new Vector2(jitter.x / camera.pixelWidth, jitter.y / camera.pixelHeight); return(cameraProj); }