shader_type canvas_item;

uniform float line_opacity : hint_range(0.0,1.0) = 0.25;
uniform int spacing = 2;
uniform float scale = 1.0;

void fragment() {
	vec2 uv = mod((FRAGCOORD.xy / scale) * TEXTURE_PIXEL_SIZE.xy, float(spacing));
	vec4 color = vec4(COLOR.rgb, 0.0);
	if(int(uv.y) == 0 || int(uv.x) == 0) {
		color.a = line_opacity;
	}
	COLOR = color;
}

//void light() {
	// Called for every pixel for every light affecting the CanvasItem.
	// Uncomment to replace the default light processing function with this one.
//}
