[gd_resource type="VisualShader" load_steps=13 format=3 uid="uid://dbcokq5fn2les"]

[ext_resource type="Texture2D" uid="uid://c8cvo15p3vosu" path="res://external/test portrait/gradients/blue_hair.tres" id="1_mue8a"]

[sub_resource type="VisualShaderNodeColorFunc" id="VisualShaderNodeColorFunc_n1g6q"]
function = 1

[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_kuvpm"]
parameter_name = "Color_Gradient"

[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_m6etp"]
input_name = "texture"

[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_s3ye8"]
parameter_name = "Luminosity_Gradient"

[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_x6ow4"]
source = 5

[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_n1g6q"]
expanded_output_ports = [0]
source = 5

[sub_resource type="VisualShaderNodeVectorCompose" id="VisualShaderNodeVectorCompose_m6etp"]

[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_yjp8t"]
expanded_output_ports = [0]
source = 5
texture = ExtResource("1_mue8a")

[sub_resource type="VisualShaderNodeColorFunc" id="VisualShaderNodeColorFunc_yjp8t"]
expanded_output_ports = [0]
function = 2

[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_fwk6d"]
input_name = "uv"

[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_jobvs"]
input_name = "vertex"

[resource]
resource_local_to_scene = true
code = "shader_type canvas_item;
render_mode blend_mix;

uniform sampler2D Color_Gradient;
uniform sampler2D Luminosity_Gradient;



void vertex() {
// Input:5
	vec2 n_out5p0 = VERTEX;


// Input:4
	vec2 n_out4p0 = UV;


// Output:0
	VERTEX = n_out5p0;
	UV = n_out4p0;


}

void fragment() {
	vec4 n_out3p0;
// Texture2D:3
	n_out3p0 = texture(TEXTURE, UV);
	float n_out3p1 = n_out3p0.r;
	float n_out3p2 = n_out3p0.g;
	float n_out3p4 = n_out3p0.a;


	vec4 n_out6p0;
// Texture2D:6
	n_out6p0 = texture(Color_Gradient, vec2(n_out3p1));


	vec3 n_out9p0;
// ColorFunc:9
	{
		vec3 c = vec3(n_out6p0.xyz);
		vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
		vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
		vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
		float d = q.x - min(q.w, q.y);
		float e = 1.0e-10;
		n_out9p0 = vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
	}
	float n_out9p1 = n_out9p0.r;
	float n_out9p2 = n_out9p0.g;


	vec4 n_out15p0;
// Texture2D:15
	n_out15p0 = texture(Luminosity_Gradient, vec2(n_out3p2));


// VectorCompose:5
	vec3 n_out5p0 = vec3(n_out9p1, n_out9p2, n_out15p0.x);


	vec3 n_out10p0;
// ColorFunc:10
	{
		vec3 c = n_out5p0;
		vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
		vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
		n_out10p0 = c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
	}


// Output:0
	COLOR.rgb = n_out10p0;
	COLOR.a = n_out3p4;


}
"
mode = 1
flags/light_only = false
nodes/vertex/0/position = Vector2(660, 160)
nodes/vertex/4/node = SubResource("VisualShaderNodeInput_fwk6d")
nodes/vertex/4/position = Vector2(-240, 160)
nodes/vertex/5/node = SubResource("VisualShaderNodeInput_jobvs")
nodes/vertex/5/position = Vector2(-240, 60)
nodes/vertex/connections = PackedInt32Array(5, 0, 0, 0, 4, 0, 0, 1)
nodes/fragment/0/position = Vector2(1000, 80)
nodes/fragment/3/node = SubResource("VisualShaderNodeTexture_n1g6q")
nodes/fragment/3/position = Vector2(-820, 80)
nodes/fragment/5/node = SubResource("VisualShaderNodeVectorCompose_m6etp")
nodes/fragment/5/position = Vector2(500, -60)
nodes/fragment/6/node = SubResource("VisualShaderNodeTexture_yjp8t")
nodes/fragment/6/position = Vector2(-340, -80)
nodes/fragment/9/node = SubResource("VisualShaderNodeColorFunc_yjp8t")
nodes/fragment/9/position = Vector2(220, -80)
nodes/fragment/10/node = SubResource("VisualShaderNodeColorFunc_n1g6q")
nodes/fragment/10/position = Vector2(740, -40)
nodes/fragment/11/node = SubResource("VisualShaderNodeTexture2DParameter_kuvpm")
nodes/fragment/11/position = Vector2(-880, -340)
nodes/fragment/13/node = SubResource("VisualShaderNodeInput_m6etp")
nodes/fragment/13/position = Vector2(-1120, 160)
nodes/fragment/14/node = SubResource("VisualShaderNodeTexture2DParameter_s3ye8")
nodes/fragment/14/position = Vector2(-880, 440)
nodes/fragment/15/node = SubResource("VisualShaderNodeTexture_x6ow4")
nodes/fragment/15/position = Vector2(-99.206764, 351.4282)
nodes/fragment/connections = PackedInt32Array(6, 0, 9, 0, 3, 1, 6, 0, 9, 1, 5, 0, 9, 2, 5, 1, 5, 0, 10, 0, 11, 0, 6, 2, 13, 0, 3, 2, 3, 4, 0, 1, 10, 0, 0, 0, 14, 0, 15, 2, 3, 2, 15, 0, 15, 0, 5, 2)
