funnymemellama/cardboard_shader.tres

99 lines
3.1 KiB
Text
Raw Normal View History

2023-09-26 21:38:02 -04:00
[gd_resource type="VisualShader" load_steps=11 format=3 uid="uid://dwd2vgoqby6rd"]
[ext_resource type="Texture2D" uid="uid://cffsdo4cit4i1" path="res://kreb.png" id="1_mkqvf"]
[ext_resource type="Texture2D" uid="uid://d0l1mjrgq6wrq" path="res://paper_tex/paper_0025_color_1k.jpg" id="2_1g1lb"]
[ext_resource type="Texture2D" uid="uid://dke8hdaqyfnsn" path="res://paper_tex/paper_0025_normal_opengl_1k.png" id="3_qtx1j"]
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_o5oup"]
expanded_output_ports = [0]
texture = ExtResource("1_mkqvf")
texture_type = 1
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_jdjui"]
texture = ExtResource("2_1g1lb")
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_kox8j"]
texture = ExtResource("3_qtx1j")
texture_type = 2
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_npjyt"]
operator = 2
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_g351s"]
operator = 2
[sub_resource type="VisualShaderNodeSwitch" id="VisualShaderNodeSwitch_fvm22"]
default_input_values = [0, false, 1, Vector3(1, 1, 1), 2, Vector3(0, 0, 0)]
op_type = 4
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_6nghl"]
input_name = "front_facing"
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_disabled, diffuse_lambert, specular_schlick_ggx;
uniform sampler2D tex_frg_2 : source_color;
uniform sampler2D tex_frg_3;
uniform sampler2D tex_frg_4 : hint_normal;
void fragment() {
// Input:8
bool n_out8p0 = FRONT_FACING;
// Texture2D:2
vec4 n_out2p0 = texture(tex_frg_2, UV);
float n_out2p4 = n_out2p0.a;
// Texture2D:3
vec4 n_out3p0 = texture(tex_frg_3, UV);
// VectorOp:5
vec3 n_out5p0 = vec3(n_out2p4) * vec3(n_out3p0.xyz);
vec3 n_out7p0;
// Switch:7
n_out7p0 = mix(n_out5p0, vec3(n_out2p0.xyz), float(n_out8p0));
// Texture2D:4
vec4 n_out4p0 = texture(tex_frg_4, UV);
// VectorOp:6
vec3 n_out6p0 = vec3(n_out2p4) * vec3(n_out4p0.xyz);
// Output:0
ALBEDO = n_out7p0;
ALPHA = n_out2p4;
NORMAL = n_out6p0;
}
"
graph_offset = Vector2(-111.967, -22.6899)
modes/cull = 2
nodes/fragment/0/position = Vector2(800, 100)
nodes/fragment/2/node = SubResource("VisualShaderNodeTexture_o5oup")
nodes/fragment/2/position = Vector2(-140, 120)
nodes/fragment/3/node = SubResource("VisualShaderNodeTexture_jdjui")
nodes/fragment/3/position = Vector2(-140, 420)
nodes/fragment/4/node = SubResource("VisualShaderNodeTexture_kox8j")
nodes/fragment/4/position = Vector2(-140, 660)
nodes/fragment/5/node = SubResource("VisualShaderNodeVectorOp_npjyt")
nodes/fragment/5/position = Vector2(240, 440)
nodes/fragment/6/node = SubResource("VisualShaderNodeVectorOp_g351s")
nodes/fragment/6/position = Vector2(240, 600)
nodes/fragment/7/node = SubResource("VisualShaderNodeSwitch_fvm22")
nodes/fragment/7/position = Vector2(540, 240)
nodes/fragment/8/node = SubResource("VisualShaderNodeInput_6nghl")
nodes/fragment/8/position = Vector2(200, 120)
nodes/fragment/connections = PackedInt32Array(2, 4, 5, 0, 3, 0, 5, 1, 4, 0, 6, 1, 2, 4, 6, 0, 2, 0, 7, 1, 5, 0, 7, 2, 7, 0, 0, 0, 8, 0, 7, 0, 2, 4, 0, 1, 6, 0, 0, 8)