19 lines
445 B
Plaintext
19 lines
445 B
Plaintext
shader_type canvas_item;
|
|
|
|
uniform float displacement_coefficient_x;
|
|
|
|
void fragment() {
|
|
vec4 environment_color = texture(SCREEN_TEXTURE, SCREEN_UV);
|
|
vec4 sprite_color = texture(TEXTURE, UV);
|
|
float gradient_factor = step(UV.y, 1);
|
|
if(sprite_color.a > 0.1){
|
|
COLOR = mix(environment_color, sprite_color, gradient_factor);
|
|
}
|
|
else{
|
|
COLOR = sprite_color
|
|
}
|
|
}
|
|
|
|
void vertex() {
|
|
VERTEX += vec2(displacement_coefficient_x,0.0) * (1.0 - UV.y);
|
|
} |