2024-10-08 20:55:57 +03:00
|
|
|
//MADE BY : @ahopness
|
|
|
|
//LICENSE : CC0
|
|
|
|
//COMATIBLE WITH : GLES2, GLES3, WEBGL
|
|
|
|
|
|
|
|
shader_type canvas_item;
|
|
|
|
|
|
|
|
|
|
|
|
uniform float sort :hint_range(0.0, 2.6)= .5;
|
|
|
|
|
|
|
|
void fragment(){
|
|
|
|
vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy;
|
2024-10-09 18:36:01 +03:00
|
|
|
|
2024-10-08 20:55:57 +03:00
|
|
|
// Pseudo Pixel Sorting
|
|
|
|
float sortThreshold = 1.0 - clamp(sort / 2.6, 0.0, 1.0);
|
|
|
|
vec2 sortUv = vec2(uv.x, sortThreshold);
|
2024-10-09 18:36:01 +03:00
|
|
|
|
2024-10-08 20:55:57 +03:00
|
|
|
// Curved melting transition
|
|
|
|
vec2 transitionUV = uv;
|
|
|
|
transitionUV.y += pow(sort, 2.0 + (sort * 2.0)) * uv.x * fract(sin(dot(vec2(transitionUV.x), vec2(12.9, 78.2)))* 437.5);
|
|
|
|
COLOR = texture(TEXTURE, transitionUV);
|
2024-10-09 18:36:01 +03:00
|
|
|
|
2024-10-08 20:55:57 +03:00
|
|
|
// Draw pixel sorting effect behind the melting transition
|
|
|
|
if(transitionUV.y > 1.){
|
|
|
|
COLOR = texture(TEXTURE, sortUv);
|
|
|
|
}else{
|
|
|
|
COLOR = texture(TEXTURE, uv);
|
|
|
|
}
|
|
|
|
}
|