From d1e050686b5c6412b80df759672da5e8b3782fef Mon Sep 17 00:00:00 2001 From: hizzlekizzle Date: Fri, 2 Sep 2016 21:23:43 -0500 Subject: [PATCH] fix pixellate, hopefpully --- retro/shaders/pixellate.slang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retro/shaders/pixellate.slang b/retro/shaders/pixellate.slang index 86fd057..5868b4f 100644 --- a/retro/shaders/pixellate.slang +++ b/retro/shaders/pixellate.slang @@ -26,9 +26,9 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec2 texelSize = 1.0 / global.SourceSize.xy; + vec2 texelSize = global.SourceSize.zw; - vec2 range = vec2(abs(global.SourceSize.z / (global.OutputSize.x * global.SourceSize.x)), abs(global.SourceSize.w / (global.OutputSize.y * global.SourceSize.y))); + vec2 range = vec2(abs(global.SourceSize.x / (global.OutputSize.x * global.SourceSize.x)), abs(global.SourceSize.y / (global.OutputSize.y * global.SourceSize.y))); range = range / 2.0 * 0.999; float left = vTexCoord.x - range.x; @@ -52,4 +52,4 @@ void main() averageColor += ((right - border.x) * (top - border.y) / totalArea) * topRightColor; FragColor = vec4(averageColor, 1.0); -} \ No newline at end of file +}