diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 202817f6ee0..e4eaab73250 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -922,7 +922,7 @@ void vertex() { VERTEX = VERTEX; POSITION = PROJECTION_MATRIX * VIEW_MATRIX * MODEL_MATRIX * vec4(VERTEX.xyz, 1.0); - POSITION.z = mix(POSITION.z, 0.0, 0.999); + POSITION.z = mix(POSITION.z, POSITION.w, 0.999); POINT_SIZE = point_size; } @@ -1201,7 +1201,7 @@ void vertex() { } VERTEX = VERTEX; POSITION = PROJECTION_MATRIX * VIEW_MATRIX * MODEL_MATRIX * vec4(VERTEX.xyz, 1.0); - POSITION.z = mix(POSITION.z, 0, 0.998); + POSITION.z = mix(POSITION.z, POSITION.w, 0.998); } void fragment() { ALBEDO = COLOR.rgb;