no depth test in viewmodel item thing

This commit is contained in:
veclavtalica 2025-02-12 12:57:12 +03:00
parent 5a4e09d6d1
commit 14d2399163
2 changed files with 4 additions and 3 deletions

View File

@ -13,9 +13,9 @@ void vertex() {
/* thanks gdquest */
void fragment() {
vec2 size = vec2(width) / vec2(textureSize(albedo_texture, 0));
vec4 sprite_color = texture(albedo_texture, UV);
float alpha = sprite_color.a;
alpha += texture(albedo_texture, UV + vec2(0.0, -size.y)).a;
alpha += texture(albedo_texture, UV + vec2(size.x, -size.y)).a;
@ -25,7 +25,7 @@ void fragment() {
alpha += texture(albedo_texture, UV + vec2(-size.x, size.y)).a;
alpha += texture(albedo_texture, UV + vec2(-size.x, 0.0)).a;
alpha += texture(albedo_texture, UV + vec2(-size.x, -size.y)).a;
vec3 final_color = mix(outline_color.rgb, sprite_color.rgb, sprite_color.a);
ALBEDO = final_color;
ALPHA = clamp(alpha, 0.0, 1.0);

View File

@ -42,6 +42,7 @@ shader_parameter/size = 1.24
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x7r08"]
resource_local_to_scene = true
next_pass = SubResource("ShaderMaterial_nch7m")
no_depth_test = true
albedo_color = Color(0.0936238, 0.825356, 1, 1)
metallic = 0.8
roughness = 0.4