From d8022779ffaf5c827dadeb8b706af528d8429537 Mon Sep 17 00:00:00 2001 From: papadanku Date: Sat, 28 Sep 2024 21:57:01 -0700 Subject: [PATCH] Update cQuantization.fx --- shaders/cQuantization.fx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/shaders/cQuantization.fx b/shaders/cQuantization.fx index 4a9e0d5..6197291 100644 --- a/shaders/cQuantization.fx +++ b/shaders/cQuantization.fx @@ -43,8 +43,15 @@ uniform int _DitherMethod < float4 PS_Color(CShade_VS2PS_Quad Input) : SV_TARGET0 { - float2 ColorMapTex = (_Pixelate) ? floor(Input.Tex0 * _Resolution) / _Resolution : Input.Tex0; - float2 HashTex = (_Pixelate) ? floor(Input.Tex0 * _Resolution) : Input.HPos.xy; + float2 ColorMapTex = Input.Tex0; + float2 HashTex = Input.HPos.xy; + + if (_Pixelate) + { + float2 Grid = floor(Input.Tex0 * _Resolution); + float2 ColorMapTex = Grid / _Resolution; + float2 HashTex = Grid; + } float4 ColorMap = tex2D(CShade_SampleGammaTex, ColorMapTex); float3 Dither = 0.0;