|
|
|
|
|
|
{ |
|
|
|
// If TAA is enabled projMatrix will hold a jittered projection matrix. The original,
|
|
|
|
// non-jittered projection matrix can be accessed via nonJitteredProjMatrix.
|
|
|
|
bool taaEnabled = Application.isPlaying && camera.cameraType == CameraType.Game && |
|
|
|
bool taaEnabled = camera.cameraType == CameraType.Game && |
|
|
|
CoreUtils.IsTemporalAntialiasingActive(postProcessLayer); |
|
|
|
|
|
|
|
var nonJitteredCameraProj = camera.projectionMatrix; |
|
|
|
|
|
|
isFirstFrame = false; |
|
|
|
} |
|
|
|
|
|
|
|
const uint taaFrameCount = 8; |
|
|
|
taaFrameIndex = taaEnabled ? (uint)Time.renderedFrameCount % taaFrameCount : 0; |
|
|
|
taaFrameIndex = taaEnabled ? (uint)postProcessLayer.temporalAntialiasing.sampleIndex : 0; |
|
|
|
taaFrameRotation = new Vector2(Mathf.Sin(taaFrameIndex * (0.5f * Mathf.PI)), |
|
|
|
Mathf.Cos(taaFrameIndex * (0.5f * Mathf.PI))); |
|
|
|
|
|
|
|