This repository has been archived on 2025-10-11. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Fragmented/examples/multistep_distort.gdshader

20 lines
329 B
Text

shader_type canvas_item;
//!steps 9
//!load ./swamp.jpg
const float strength = 0.01;
void fragment() {
float v;
if (STEP % 3 == 0) {
v = COLOR.r; // 3 times
} else if (STEP % 3 == 0) {
v = COLOR.g; // 3 times
} else {
v = COLOR.b; // 3 times
}
vec2 uv = UV;
uv.y -= v * strength;
COLOR = texture(TEXTURE, uv);
}