Shader code
shader_type canvas_item;
render_mode blend_mix;
uniform float fade : hint_range( 0.0, 1.0, 0.01 ) = 0.0;
uniform float tiling : hint_range(0.0, 100.0, 1.0) = 10.0;
float get_grid( vec2 uv )
{
uv = abs( uv );
return float( int( uv.x * 100.0 ) % int( ( 1.0 - pow( fade, 2 ) ) * 100. ) ) * float( int( uv.y * 100.0 ) % int( ( 1.0 - pow( fade, 2 ) ) * 100. ) );
}
float get_line( float uv )
{
uv = mod( uv * tiling, 1.0 );
return round( ( min( uv, 1.0 - uv ) / ( fade )) );
}
void fragment()
{
COLOR.a = COLOR.a * ( get_line( UV.x ) * get_line( UV.y ) );
}
Tags
2d,
fade,
retro,
square,
transition
Hi,
How to use this animation, you need to tween, the fade property ?
Thnaks