Browse Source

Further tweaked motion vector processing, now the camera motion vectors from Unity produce an exact match with the auto-generated motion from the clip-delta matrix, in both D3D, Vulkan and OpenGL. It also makes sense with regards to the flipped Y-coordinate in screen space now. The final result looks good now too.

sgsr2_fs
Nico de Poel 1 year ago
parent
commit
a56f0742b5
  1. 5
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_birp.hlsl
  2. 5
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl

5
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_birp.hlsl

@ -21,10 +21,9 @@ SamplerState s_LinearClamp : register(s1);
inline float2 decodeVelocityFromTexture(float2 ev)
{
// Nothing much to do, motion vectors are not encoded
#if UNITY_UV_STARTS_AT_TOP
return -ev;
return float2(ev.x, -ev.y) * 2.0f;
#else
return ev;
return ev * 2.0f;
#endif
}

5
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl

@ -9,10 +9,9 @@
inline float2 decodeVelocityFromTexture(float2 ev)
{
// Nothing much to do, motion vectors are not encoded
#if UNITY_UV_STARTS_AT_TOP
return -ev;
return float2(ev.x, -ev.y) * 2.0f;
#else
return ev;
return ev * 2.0f;
#endif
}
Loading…
Cancel
Save