diff --git a/Game/Assets/HUD/Croshair.material b/Game/Assets/HUD/Croshair.material new file mode 100644 index 0000000..5dbedca Binary files /dev/null and b/Game/Assets/HUD/Croshair.material differ diff --git a/Game/Assets/HUD/Croshair.tres b/Game/Assets/HUD/Croshair.tres new file mode 100644 index 0000000..f519416 --- /dev/null +++ b/Game/Assets/HUD/Croshair.tres @@ -0,0 +1,104 @@ +[gd_resource type="VisualShader" load_steps=6 format=3 uid="uid://dos1mlwtb3tju"] + +[sub_resource type="VisualShaderNodeColorFunc" id="VisualShaderNodeColorFunc_15wpt"] +default_input_values = [0, Vector3(0, 0, 0)] +expanded_output_ports = [] + +[sub_resource type="VisualShaderNodeSwitch" id="VisualShaderNodeSwitch_w5e8y"] +default_input_values = [0, false, 1, Vector3(0, 0, 0), 2, Vector3(1, 1, 1)] +expanded_output_ports = [] +op_type = 2 + +[sub_resource type="VisualShaderNodeCompare" id="VisualShaderNodeCompare_8o1qy"] +default_input_values = [0, 0.0, 1, 0.9, 2, 1e-05] +expanded_output_ports = [] +function = 2 + +[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_0xt2k"] +default_input_values = [] +expanded_output_ports = [] +input_name = "screen_uv" + +[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_33whc"] +default_input_values = [] +expanded_output_ports = [] +source = 1 + +[resource] +code = "shader_type canvas_item; +render_mode unshaded; + + + + +void fragment() { +// Input:2 + vec3 n_out2p0 = vec3(SCREEN_UV, 0.0); + + + vec3 n_out8p0; + float n_out8p1; +// Texture2D:8 + { + vec4 _tex_read = textureLod(SCREEN_TEXTURE, n_out2p0.xy, 0.0); + n_out8p0 = _tex_read.rgb; + n_out8p1 = _tex_read.a; + } + + + vec3 n_out10p0; +// ColorFunc:10 + { + vec3 c = n_out8p0; + float max1 = max(c.r, c.g); + float max2 = max(max1, c.b); + float max3 = max(max1, max2); + n_out10p0 = vec3(max3, max3, max3); + } + + +// Compare:13 + float n_in13p1 = 0.90000; + bool n_out13p0 = dot(n_out10p0, vec3(0.333333, 0.333333, 0.333333)) > n_in13p1; + + + vec3 n_out12p0; +// Switch:12 + vec3 n_in12p1 = vec3(0.00000, 0.00000, 0.00000); + vec3 n_in12p2 = vec3(1.00000, 1.00000, 1.00000); + if(n_out13p0) + { + n_out12p0 = n_in12p1; + } + else + { + n_out12p0 = n_in12p2; + } + + +// Output:0 + COLOR.rgb = n_out12p0; + + +} +" +graph_offset = Vector2(408.331, -13.6599) +engine_version = { +"major": 4, +"minor": 0 +} +mode = 1 +flags/light_only = false +flags/unshaded = true +nodes/fragment/0/position = Vector2(820, 220) +nodes/fragment/2/node = SubResource( "VisualShaderNodeInput_0xt2k" ) +nodes/fragment/2/position = Vector2(-520, 380) +nodes/fragment/8/node = SubResource( "VisualShaderNodeTexture_33whc" ) +nodes/fragment/8/position = Vector2(-220, 360) +nodes/fragment/10/node = SubResource( "VisualShaderNodeColorFunc_15wpt" ) +nodes/fragment/10/position = Vector2(-40, 300) +nodes/fragment/12/node = SubResource( "VisualShaderNodeSwitch_w5e8y" ) +nodes/fragment/12/position = Vector2(560, 220) +nodes/fragment/13/node = SubResource( "VisualShaderNodeCompare_8o1qy" ) +nodes/fragment/13/position = Vector2(360, 220) +nodes/fragment/connections = PackedInt32Array(2, 0, 8, 0, 8, 0, 10, 0, 10, 0, 13, 0, 13, 0, 12, 0, 12, 0, 0, 0) diff --git a/Game/Assets/HUD/HUD.tscn b/Game/Assets/HUD/HUD.tscn index b3544bc..917e16d 100644 --- a/Game/Assets/HUD/HUD.tscn +++ b/Game/Assets/HUD/HUD.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=22 format=3 uid="uid://bff5uslrxesjx"] +[gd_scene load_steps=23 format=3 uid="uid://bff5uslrxesjx"] [ext_resource type="Texture2D" uid="uid://blnjjtjifk22i" path="res://Assets/HUD/Vignette.png" id="1"] [ext_resource type="Script" path="res://Assets/HUD/HUD.gd" id="1_wc430"] [ext_resource type="Shader" uid="uid://bet2pthddt01v" path="res://Assets/HUD/HUD.tres" id="2_djyym"] [ext_resource type="Texture2D" uid="uid://dim1jrwuiy4qt" path="res://Assets/HUD/Crosshair Baseline.png" id="3_r05jh"] +[ext_resource type="Material" uid="uid://dkf0bpi007o2q" path="res://Assets/HUD/Croshair.material" id="4_f6eam"] [ext_resource type="Texture2D" uid="uid://d0p7vfc62t5sb" path="res://Assets/HUD/Crosshair Hit.png" id="4_guqkl"] [ext_resource type="AudioStream" uid="uid://dfcyohpsqvri1" path="res://Assets/SFX/HUD_Confirm_Hit.wav" id="4_llqcq"] [ext_resource type="Script" path="res://Assets/HUD/Crosshair.gd" id="5"] @@ -153,6 +154,11 @@ __meta__ = { [node name="Baseline" type="TextureRect" parent="Crosshair"] texture_filter = 1 texture_repeat = 1 +material = ExtResource( "4_f6eam" ) +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 offset_left = -16.0 offset_top = -16.0 offset_right = 16.0 @@ -167,6 +173,11 @@ __meta__ = { modulate = Color(1, 1, 1, 0) texture_filter = 1 texture_repeat = 1 +material = ExtResource( "4_f6eam" ) +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 offset_left = -16.0 offset_top = -16.0 offset_right = 16.0 @@ -181,6 +192,11 @@ __meta__ = { modulate = Color(1, 1, 1, 0) texture_filter = 1 texture_repeat = 1 +material = ExtResource( "4_f6eam" ) +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 offset_left = -16.0 offset_top = -16.0 offset_right = 16.0