Scratch mosaic effect

Acts just like the mosaic effect from Scratch

Shader code
shader_type canvas_item;

uniform float amount = 0.0;

void vertex() {
	if (amount != 0.0) {
		float newAmount = trunc(((abs(amount) + 5.0) / 10.0) + 1.0);
		UV = UV * vec2(newAmount);
	}
}
Tags
Scratch
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from The2AndOnly

Scratch brightness effect

Fnaf / Clickteam perspective (displacement) – Godot 4.2

Scratch whirl effect

Related shaders

Scratch pixelate effect

Scratch color effect

Scratch whirl effect

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
oLe Studios
6 days ago

Hi, this shader is only for godot 4, but i re-code it:

shader_type canvas_item;

uniform float amount_x : hint_range(1, 500) = 2.0;  // Número de repeticiones en el eje X
uniform float amount_y : hint_range(1, 500) = 2.0;  // Número de repeticiones en el eje Y

void vertex() {
    UV = UV * vec2(amount_x, amount_y);
}

void fragment() {
    vec2 repeated_uv = fract(UV);  // Esto asegura que las coordenadas UV se repitan correctamente
    COLOR = texture(TEXTURE, repeated_uv);
}
This code can add a mosaic effect in the X cord and Y cord

DESIGNED AND TESTED IN/FOR GODOT 3.5

Last edited 6 days ago by oLe Studios