shader_type spatial;

varying vec3 pos;
varying vec3 norm;
uniform sampler2D space_color : source_color, repeat_disable;
uniform vec3 line_color : source_color;

uniform float scale = 1000.0;

#include "noise.gdshaderinc"

void vertex() {
	norm = NORMAL;
	pos = VERTEX;
}

void fragment() {
	ALBEDO = line_color;
	if (norm.y > 0.7 && mod(pos.y, 5) > 0.2) {
		float f = shell_worley(pos, scale);
		ALBEDO = texture(space_color, vec2(f)).rgb;
	}  
}