From bb619c2c44cfcf93ccce232bd6541ef16e4c53f9 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 16 May 2026 17:22:45 -0700 Subject: [PATCH] add configurable dot size for zoomed-out structures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Structures collapse to a dot when zoomed out past dotsZoomThreshold. The dot scale was hardcoded to 1.0 / 2.5 (≈0.4) in structure.vert.glsl. Promote it to a render setting (`structure.dotScale`) so it's tunable alongside iconSize / dotsZoomThreshold. Default 0.4 preserves current behavior. Plumbed via uDotScale uniform on StructurePass. --- src/client/render/gl/passes/structure-pass.ts | 3 +++ src/client/render/gl/render-settings.json | 7 ++++--- src/client/render/gl/render-settings.ts | 2 ++ src/client/render/gl/shaders/structure/structure.vert.glsl | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/client/render/gl/passes/structure-pass.ts b/src/client/render/gl/passes/structure-pass.ts index d0f89c258..ea186f0ea 100644 --- a/src/client/render/gl/passes/structure-pass.ts +++ b/src/client/render/gl/passes/structure-pass.ts @@ -74,6 +74,7 @@ export class StructurePass { private uZoom: WebGLUniformLocation; private uIconSize: WebGLUniformLocation; private uDotsThreshold: WebGLUniformLocation; + private uDotScale: WebGLUniformLocation; private uScaleFactor: WebGLUniformLocation; private uShapeScales: WebGLUniformLocation; private uIconFills: WebGLUniformLocation; @@ -140,6 +141,7 @@ export class StructurePass { this.uCamera = gl.getUniformLocation(this.program, "uCamera")!; this.uZoom = gl.getUniformLocation(this.program, "uZoom")!; this.uIconSize = gl.getUniformLocation(this.program, "uIconSize")!; + this.uDotScale = gl.getUniformLocation(this.program, "uDotScale")!; this.uDotsThreshold = gl.getUniformLocation( this.program, "uDotsThreshold", @@ -330,6 +332,7 @@ export class StructurePass { gl.uniform1f(this.uZoom, zoom); gl.uniform1f(this.uIconSize, ss.iconSize); gl.uniform1f(this.uDotsThreshold, ss.dotsZoomThreshold); + gl.uniform1f(this.uDotScale, ss.dotScale); gl.uniform1f(this.uScaleFactor, ss.iconScaleFactorZoomedOut); // Build per-structure uniform arrays from settings, ordered by atlas column diff --git a/src/client/render/gl/render-settings.json b/src/client/render/gl/render-settings.json index c956c4ce8..b9da108d4 100644 --- a/src/client/render/gl/render-settings.json +++ b/src/client/render/gl/render-settings.json @@ -82,9 +82,10 @@ "railAlpha": 1 }, "structure": { - "iconSize": 35, - "dotsZoomThreshold": 0.5, - "iconScaleFactorZoomedOut": 1.4, + "iconSize": 65, + "dotsZoomThreshold": 1.2, + "dotScale": 0.3, + "iconScaleFactorZoomedOut": 3.5, "shapes": { "City": { "scale": 1, diff --git a/src/client/render/gl/render-settings.ts b/src/client/render/gl/render-settings.ts index bd67bfea5..adbd373cf 100644 --- a/src/client/render/gl/render-settings.ts +++ b/src/client/render/gl/render-settings.ts @@ -86,6 +86,8 @@ export interface RenderSettings { structure: { iconSize: number; dotsZoomThreshold: number; + /** Icon size multiplier when zoomed out past dotsZoomThreshold. */ + dotScale: number; iconScaleFactorZoomedOut: number; shapes: Record; highlightOutlineWidth: number; diff --git a/src/client/render/gl/shaders/structure/structure.vert.glsl b/src/client/render/gl/shaders/structure/structure.vert.glsl index a0b1a6d75..b71006637 100644 --- a/src/client/render/gl/shaders/structure/structure.vert.glsl +++ b/src/client/render/gl/shaders/structure/structure.vert.glsl @@ -12,6 +12,7 @@ uniform float uZoom; uniform float uIconSize; uniform float uDotsThreshold; +uniform float uDotScale; uniform float uScaleFactor; uniform float uShapeScales[ATLAS_COLS]; uniform float uIconFills[ATLAS_COLS]; @@ -36,7 +37,7 @@ void main() { float iconScale; if (uZoom <= uDotsThreshold) { - iconScale = 1.0 / 2.5; + iconScale = uDotScale; } else { iconScale = min(1.0, uZoom / uScaleFactor); }