Animation fixes

This commit is contained in:
2024-09-16 20:38:44 -07:00
parent d0c78e54a7
commit 354813e6e0
292 changed files with 6049 additions and 678 deletions

View File

@@ -1,12 +1,44 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://pq2fqq4ophsy"]
[ext_resource type="Shader" path="res://src/items/PickupItem.gdshader" id="1_hcihy"]
[sub_resource type="Shader" id="Shader_xtf8b"]
resource_local_to_scene = true
code = "shader_type spatial;
render_mode unshaded, cull_disabled, depth_draw_always, depth_test_disabled;
uniform vec3 color = vec3(0.0, 1.0, 0.0);
uniform float line_width : hint_range(0.0, 10.0) = 0.85;
varying vec3 barycentric;
void vertex() {
vec3 b_coords[3] = vec3[](vec3(1, 0, 0), vec3(0, 1, 0), vec3(0, 0, 1));
int vertex_id = int(VERTEX_ID) % 3;
barycentric = b_coords[vertex_id];
}
void fragment() {
// Calculate the screen-space derivatives of the barycentric coordinates
vec3 dFdx_barycentric = dFdx(barycentric);
vec3 dFdy_barycentric = dFdy(barycentric);
// Calculate the minimum barycentric coordinate value
float min_bary = min(min(barycentric.x, barycentric.y), barycentric.z);
// Calculate the screen-space line width
float screen_line_width = line_width * length(vec2(dFdx_barycentric.x, dFdy_barycentric.x));
// Draw the line based on the calculated screen-space line width
if (min_bary < screen_line_width) {
ALBEDO = color;
} else {
discard;
}
}
"
[resource]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("1_hcihy")
shader_parameter/shine_color = Color(1, 1, 1, 1)
shader_parameter/cycle_interval = 1.0
shader_parameter/shine_speed = 3.0
shader_parameter/shine_width = 3.0
shader = SubResource("Shader_xtf8b")
shader_parameter/color = Vector3(0, 1, 0)
shader_parameter/line_width = 0.85