|
|
|
@ -215,19 +215,13 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private int _frameIndex; |
|
|
|
|
|
|
|
private void ApplyJitter(Camera camera) |
|
|
|
{ |
|
|
|
var scaledRenderSize = GetScaledRenderSize(camera); |
|
|
|
|
|
|
|
// Stop frame debugger from freaking out
|
|
|
|
if (Time.deltaTime > 0) |
|
|
|
_frameIndex++; |
|
|
|
|
|
|
|
// Perform custom jittering of the camera's projection matrix according to FSR's recipe
|
|
|
|
int jitterPhaseCount = Fsr2.GetJitterPhaseCount(scaledRenderSize.x, _upscaleSize.x); |
|
|
|
Fsr2.GetJitterOffset(out float jitterX, out float jitterY, _frameIndex, jitterPhaseCount); |
|
|
|
Fsr2.GetJitterOffset(out float jitterX, out float jitterY, Time.frameCount, jitterPhaseCount); |
|
|
|
|
|
|
|
JitterOffset = new Vector2(jitterX, jitterY); |
|
|
|
|
|
|
|
|