#What's Wrong with my Pixelation Shader?

4 messages · Page 1 of 1 (latest)

blazing stag
#

I Have this Basic Pixelation Shader (Version 450 core)

vec2 ScaledCoord = TexCoord.st;
ScaledCoord.x -= mod2(ScaledCoord.x, 1.0 / 256);
ScaledCoord.y -= mod2(ScaledCoord.y, 1.0 / 240);

Which just Downscales the Image to a 256x240 Resolution.
The Problem is, that it produces this weird noise around some lines
for example, when i stretch the Texture, the lines get thicker and this weird noise appears around it (attached image)
Does Anybody know what's Wrong?

Things i've tried:
#extension GL_EXT_gpu_shader4 : enable
#extension GL_ARB_gpu_shader_fp64 : enable
#extension GL_NV_gpu_shader_fp64 : enable
precision highp float;

it's kinda my first time working with GLSL shaders and i don't know what's going on

#

by the way, i did use Nearest Neighbor Scaling on the Image, because i'm going for a pixelart-y look

craggy pecan
#

your texcoords are non-continuos, which means you'll get undefined gradients

#

use explicit gradients