From e196d399b4e8a5db4da2fc205d051de1a7a84a60 Mon Sep 17 00:00:00 2001 From: Antonio Lentini <111151429+lentscode@users.noreply.github.com> Date: Mon, 29 Jun 2026 22:42:36 +0200 Subject: [PATCH] feat: Change factory icons from circles to hexagons (#4439) Resolves #4413 ## Description: The factory and city icons are currently undistinguishable when zooming out, this PR changes the factory icon to be hexagon-shaped. It also increases the icon scale (now equal to port) to put some padding around. *Before* Before *After (with `scale = 1.0`)* After (with `scale = 1.0`) *After (with `scale = 1.08`)* After (with `scale = 1.08`) ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory ## Please put your Discord username so you can be contacted if a bug or regression is found: lents --- src/client/render/gl/render-settings.json | 2 +- src/client/render/gl/shaders/structure/structure.frag.glsl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/render/gl/render-settings.json b/src/client/render/gl/render-settings.json index 76e0d27a8..c3c4e1269 100644 --- a/src/client/render/gl/render-settings.json +++ b/src/client/render/gl/render-settings.json @@ -134,7 +134,7 @@ "iconFill": 0.85 }, "Factory": { - "scale": 1, + "scale": 1.08, "iconFill": 0.85 }, "Defense Post": { diff --git a/src/client/render/gl/shaders/structure/structure.frag.glsl b/src/client/render/gl/shaders/structure/structure.frag.glsl index f8bc39fef..287fa424b 100644 --- a/src/client/render/gl/shaders/structure/structure.frag.glsl +++ b/src/client/render/gl/shaders/structure/structure.frag.glsl @@ -64,10 +64,12 @@ float sdPolygon(vec2 p, float R, float n, float rot) { // Per-structure-type shape SDF. // Atlas indices: 0=City, 1=Port, 2=Factory, 3=DefensePost, 4=SAM, 5=Silo float shapeSDF(vec2 p, float R) { - if (vAtlasIdx < 0.5 || (vAtlasIdx > 1.5 && vAtlasIdx < 2.5)) - return length(p) - R; // City / Factory → circle + if (vAtlasIdx < 0.5) + return length(p) - R; // City → circle if (vAtlasIdx < 1.5) return sdPolygon(p, R, 5.0, PI * 0.5); // Port → pentagon (vertex up) + if (vAtlasIdx < 2.5) + return sdPolygon(p, R, 6.0, PI / 6.0); // Factory → hexagon (flat top) if (vAtlasIdx < 3.5) return sdPolygon(p, R, 8.0, 0.0); // Defense Post → octagon (flat top) if (vAtlasIdx < 4.5)