shader_type spatial; render_mode unshaded, cull_disabled, depth_draw_never, blend_mix, shadows_disabled; // A physical kill (juice pass 2026-09-29): one side of the enemy's billboard // along the killing slash's line. The line runs through `point` (UV) with // `normal` (UV, pointing to the kept side when `side` is 1). EnemyDisplay3D // draws two, one per side, and pushes them apart along the normal. uniform sampler2D tex : source_color, filter_linear_mipmap; uniform vec2 point = vec2(0.5, 0.5); uniform vec2 normal = vec2(1.0, 0.0); uniform float side = 1.0; void vertex() { // Billboarded like the sprite, keeping its scale. MODELVIEW_MATRIX = VIEW_MATRIX * mat4( INV_VIEW_MATRIX[0] * length(MODEL_MATRIX[0].xyz), INV_VIEW_MATRIX[1] * length(MODEL_MATRIX[1].xyz), INV_VIEW_MATRIX[2] * length(MODEL_MATRIX[2].xyz), MODEL_MATRIX[3]); MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX); } void fragment() { if (dot(UV - point, normal) * side < 0.0) { discard; } vec4 c = texture(tex, UV); if (c.a < 0.01) { discard; } ALBEDO = c.rgb * COLOR.rgb; ALPHA = c.a * COLOR.a; }