diff --git a/shaders/kDatamosh.fx b/shaders/kDatamosh.fx index a46cec7..dd82fa9 100644 --- a/shaders/kDatamosh.fx +++ b/shaders/kDatamosh.fx @@ -212,7 +212,7 @@ float2 GetMVBlocks(float2 MV, float2 Tex, out float3 Random) Random.z = RandUV(Tex.yx - Time.xx); // Normalized screen space -> Pixel coordinates - MV = CMotionEstimation_UnnormalizeMotionVectors(MV * _Scale, TexSize); + MV = CMotionEstimation_UnnormalizeMV(MV * _Scale, TexSize); // Small random displacement (diffusion) MV += (Random.xy - 0.5) * _Diffusion; @@ -275,7 +275,7 @@ float4 PS_Datamosh(CShade_VS2PS_Quad Input) : SV_TARGET0 float RandomMotion = RandUV(Input.Tex0 + length(MV)); // Pixel coordinates -> Normalized screen space - MV = CMotionEstimation_NormalizeMotionVectors(MV, TexSize); + MV = CMotionEstimation_NormalizeMV(MV, TexSize); // Color from the original image float4 Source = CShade_BackBuffer2D(Input.Tex0); diff --git a/shaders/shared/cMotionEstimation.fxh b/shaders/shared/cMotionEstimation.fxh index 179f52f..ed63db5 100644 --- a/shaders/shared/cMotionEstimation.fxh +++ b/shaders/shared/cMotionEstimation.fxh @@ -7,13 +7,13 @@ #define INCLUDE_CMOTIONESTIMATION // [-1.0, 1.0] -> [Width, Height] - float2 CMotionEstimation_UnnormalizeMotionVectors(float2 Vectors, float2 ImageSize) + float2 CMotionEstimation_UnnormalizeMV(float2 Vectors, float2 ImageSize) { return Vectors / abs(ImageSize); } // [Width, Height] -> [-1.0, 1.0] - float2 CMotionEstimation_NormalizeMotionVectors(float2 Vectors, float2 ImageSize) + float2 CMotionEstimation_NormalizeMV(float2 Vectors, float2 ImageSize) { return clamp(Vectors * abs(ImageSize), -1.0, 1.0); } @@ -116,7 +116,7 @@ Vectors = CMath_HalfToNorm(Vectors); // Propagate normalized motion vectors in Norm Range - Vectors += CMotionEstimation_NormalizeMotionVectors(Flow, PixelSize); + Vectors += CMotionEstimation_NormalizeMV(Flow, PixelSize); // Clamp motion vectors to restrict range to valid lengths Vectors = clamp(Vectors, -1.0, 1.0);