added weapon holstering

This commit is contained in:
derek
2025-01-15 12:40:22 -06:00
parent b63aa7db37
commit 0a4e4eefb3
9 changed files with 105 additions and 49 deletions

View File

@@ -22,8 +22,8 @@ float getDepth(vec2 screen_uv, sampler2D depth_texture, mat4 inv_projection_matr
// Credit: https://godotshaders.com/shader/depth-modulated-pixel-outline-in-screen-space/
float raw_depth = texture(depth_texture, screen_uv)[0];
vec3 normalized_device_coordinates = vec3(screen_uv * 2.0 - 1.0, raw_depth);
vec4 view_space = inv_projection_matrix * vec4(normalized_device_coordinates, 1.0);
view_space.xyz /= view_space.w;
vec4 view_space = inv_projection_matrix * vec4(normalized_device_coordinates, 1.0);
view_space.xyz /= view_space.w;
return -view_space.z;
}
@@ -47,7 +47,7 @@ void vertex(){
void fragment() {
vec2 e = vec2(1./VIEWPORT_SIZE.xy);
// Shadows
float depth_diff = 0.0;
float neg_depth_diff = .5;
@@ -70,7 +70,7 @@ void fragment() {
depth_diff = smoothstep(0.2, 0.3, depth_diff);
// ALBEDO = vec3(neg_depth_diff);
}
// Highlights
float normal_diff = 0.;
if (highlights_enabled) {
@@ -88,7 +88,7 @@ void fragment() {
normal_diff = clamp(normal_diff-neg_depth_diff, 0., 1.);
// ALBEDO = vec3(normal_diff);
}
vec3 original_color = texture(SCREEN_TEXTURE, SCREEN_UV).rgb;
vec3 final_highlight_color = mix(original_color, highlight_color, highlight_strength);

View File

@@ -529,7 +529,7 @@ audio_empty = NodePath("Audio/Empty")
audio_reload = NodePath("Audio/Reload")
[node name="mac10" parent="." index="0"]
transform = Transform3D(-1.08301e-06, -8.05116e-08, -0.3, -0.0225093, 0.299154, 9.74567e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
transform = Transform3D(-1.08301e-06, -8.05114e-08, -0.3, -0.0225093, 0.299154, 9.74772e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
lod_bias = 10.0
mesh = SubResource("ArrayMesh_pcg38")