|
|
|
@ -47,7 +47,7 @@ namespace FidelityFX |
|
|
|
|
|
|
|
private void OnEnable() |
|
|
|
{ |
|
|
|
Fsr2.InitializationFlags flags = Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation; |
|
|
|
Fsr2.InitializationFlags flags = 0; |
|
|
|
if (enableFP16) |
|
|
|
flags |= Fsr2.InitializationFlags.EnableFP16Usage; |
|
|
|
|
|
|
|
@ -191,7 +191,7 @@ namespace FidelityFX |
|
|
|
_dispatchDescription.Reset = _reset; |
|
|
|
_reset = false; |
|
|
|
|
|
|
|
// Perform custom jittering of the camera's projection matrix according to FSR2's instructions
|
|
|
|
// Perform custom jittering of the camera's projection matrix according to FSR2's documentation
|
|
|
|
int jitterPhaseCount = Fsr2.GetJitterPhaseCount(_renderSize.x, _displaySize.x); |
|
|
|
Fsr2.GetJitterOffset(out float jitterX, out float jitterY, Time.frameCount, jitterPhaseCount); |
|
|
|
|
|
|
|
@ -201,7 +201,9 @@ namespace FidelityFX |
|
|
|
jitterY = 2.0f * jitterY / _renderSize.y; |
|
|
|
|
|
|
|
var jitterTranslationMatrix = Matrix4x4.Translate(new Vector3(jitterX, jitterY, 0)); |
|
|
|
_renderCamera.nonJitteredProjectionMatrix = _renderCamera.projectionMatrix; |
|
|
|
_renderCamera.projectionMatrix = jitterTranslationMatrix * _renderCamera.nonJitteredProjectionMatrix; |
|
|
|
_renderCamera.useJitteredProjectionMatrixForTransparentRendering = false; |
|
|
|
} |
|
|
|
|
|
|
|
private void OnRenderImage(RenderTexture src, RenderTexture dest) |
|
|
|
|