Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TobiLa |
Hey,
I am using the following shader to make my sprite fade out at the bottom:
shader_type canvas_item;
uniform float progress : hint_range(0,1); uniform float clip_height =
0.05;
void fragment(){
vec4 main_texture = texture(TEXTURE, UV);
//main_texture.a *= 1.0 - step(1.0 - progress, UV.y); main_texture.a *= 1.0 - smoothstep(1.0 - progress - clip_height,1.0 - progress + clip_height, UV.y);
COLOR = main_texture; }
Now when I add rotation, my fade effect gets rotated with it as the shader seems to be applied before the rotation:
How can I achieve that my rotated object has an even fade effect from bottom to top even when rotated, so it looks like this?
Thanks for your help!