From aae36b740e785f06762847a085d864fc1f7cda5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Tue, 26 Aug 2025 10:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Pixelization=E7=9D=80?= =?UTF-8?q?=E8=89=B2=E5=99=A8=EF=BC=8C=E6=94=AF=E6=8C=81=E5=83=8F=E7=B4=A0?= =?UTF-8?q?=E5=8C=96=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaders/Pixelization.gdshader | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 shaders/Pixelization.gdshader diff --git a/shaders/Pixelization.gdshader b/shaders/Pixelization.gdshader new file mode 100644 index 0000000..f950894 --- /dev/null +++ b/shaders/Pixelization.gdshader @@ -0,0 +1,7 @@ +shader_type canvas_item; +uniform int pixelSize; + +void fragment() { + vec2 uv = UV - mod(UV, vec2(float(pixelSize)) / vec2(textureSize(TEXTURE, 0))); + COLOR = texture(TEXTURE, uv); +} \ No newline at end of file