fix(minimap): keep a single player direction indicator

This commit is contained in:
Kelsi 2026-03-14 06:48:14 -07:00
parent 5b195781ad
commit 76f54bbd2c
2 changed files with 16 additions and 23 deletions

View file

@ -44,8 +44,22 @@ void main() {
vec4 mapColor = texture(uComposite, mapUV);
// Player direction arrow is rendered by GameScreen minimap overlays.
// Keep shader output to map imagery only to avoid duplicate indicators.
// Single player direction indicator (center arrow) rendered in-shader.
vec2 local = center; // [-0.5, 0.5] around minimap center
float ac = cos(push.arrowRotation);
float as = sin(push.arrowRotation);
vec2 tip = vec2(0.0, 0.09);
vec2 left = vec2(-0.045, -0.02);
vec2 right = vec2( 0.045, -0.02);
mat2 rot = mat2(ac, -as, as, ac);
tip = rot * tip;
left = rot * left;
right = rot * right;
if (pointInTriangle(local, tip, left, right)) {
mapColor.rgb = vec3(1.0, 0.86, 0.05);
}
float centerDot = smoothstep(0.016, 0.0, length(local));
mapColor.rgb = mix(mapColor.rgb, vec3(1.0), centerDot * 0.95);
// Dark border ring
float border = smoothstep(0.48, 0.5, dist);