Hello, I'm trying to dive into learning shaders and am trying to create a shader on a colorRect that masks out a texture(sampler2d) (which I managed). Now I want to be able to resize the texture so that it can shrink down to nothing or expand so that the entire colorRect is transparent. The second thing I want to do is have the mask rotate. Can anyone point me in the right direction?
shader_type canvas_item;
render_mode unshaded;
uniform float cutoff : hint_range(0.0, 1.0) = 0.5;
uniform sampler2D mask : hint_albedo;
void fragment()
{
float value = texture(mask, UV).r;
if (value < cutoff) {
COLOR = vec4(COLOR.rgb, 0.0);
}
else {
COLOR = vec4(COLOR.rgb, 1.0);
}
}
I'm trying to achieve a transition similar to this video at 16:08:
Basically a transition between scenes but with a rotating logo instead of a circle.