@@ -30,9 +30,6 @@ uniform vec3 uLandColor;
3030uniform vec4 uMarkers[${ MARKER_CAPACITY } ];
3131uniform int uMarkerCount;
3232uniform vec3 uMarkerColor;
33- uniform vec3 uHubMarkerColor;
34- uniform int uPointerActive;
35- uniform vec2 uPointerCenter;
3633uniform int uPointerTrailCount;
3734uniform vec4 uPointerTrail[8];
3835
@@ -86,9 +83,8 @@ void main() {
8683 discard;
8784 }
8885 float markerType = markerTypeAtCellCenterPx(center);
89- float pointerHalo = 0.0;
9086 float pointerTrail = 0.0;
91- const float trailDecay = 1 .2;
87+ const float trailDecay = 2 .2;
9288 for (int i = 0; i < 8; i++) {
9389 if (i >= uPointerTrailCount) {
9490 break;
@@ -98,50 +94,40 @@ void main() {
9894 float age = clamp(entry.z, 0.0, 1.0);
9995 float fade = exp(-trailDecay * age);
10096 float centerDist = length(center - trailPos);
101- float centerInfluence = clamp(1.0 - centerDist / (uCell * 8.0), 0.0, 1.0 );
97+ float centerInfluence = exp(- centerDist / (uCell * 3.2) );
10298 pointerTrail += fade * centerInfluence;
103- if (markerType > 0.5) {
104- float haloRadius = 0.5 * uSquare + 1.5 * uCell;
105- float haloDist = length(fragPx - trailPos);
106- float haloInfluence = clamp(1.0 - haloDist / haloRadius, 0.0, 1.0);
107- pointerHalo = max(pointerHalo, fade * haloInfluence * haloInfluence * 0.35);
108- }
109- }
110- if (uPointerActive > 0 && markerType > 0.5) {
111- float haloRadius = 0.5 * uSquare + 2.5 * uCell;
112- float haloDist = length(fragPx - uPointerCenter);
113- float haloFactor = clamp(1.0 - haloDist / haloRadius, 0.0, 1.0);
114- pointerHalo = max(pointerHalo, haloFactor * 0.6);
11599 }
100+ pointerTrail = clamp(pointerTrail, 0.0, 1.0);
116101 vec2 landUV = vec2(uv.x, 1.0 - uv.y);
117102 float seaCoverage = sampleCoverage(landUV);
118103 float landCoverage = 1.0 - seaCoverage;
119104 if (markerType <= 0.5 && landCoverage < 0.5) {
120105 discard;
121106 }
122107 vec3 color = uLandColor;
123- if (markerType > 1.5) {
124- color = uHubMarkerColor;
125- } else if (markerType > 0.5) {
108+ if (markerType > 0.5) {
126109 color = uMarkerColor;
127110 }
128- pointerTrail = clamp(pointerTrail, 0.0, 1.0);
129111 float halfSquare = 0.5 * uSquare;
130112 if (pointerTrail > 0.0 && markerType <= 0.5) {
131- float shrink = clamp(1.0 - pointerTrail * 0.12 , 0.9 , 1.0);
113+ float shrink = clamp(1.0 - pointerTrail * 0.4 , 0.55 , 1.0);
132114 halfSquare *= shrink;
133115 }
116+ float activeHalo = 0.0;
117+ if (markerType > 1.5) {
118+ float haloRadius = 0.5 * uSquare + 1.5 * uCell;
119+ float haloDist = length(fragPx - center);
120+ float haloFactor = clamp(1.0 - haloDist / haloRadius, 0.0, 1.0);
121+ activeHalo = haloFactor * haloFactor;
122+ halfSquare *= clamp(1.0 - activeHalo * 0.3, 0.7, 1.0);
123+ }
134124 vec2 delta = abs(fragPx - center);
135125 if (delta.x > halfSquare || delta.y > halfSquare) {
136126 discard;
137127 }
138- float alpha = 1.0;
139- if (pointerTrail > 0.0 && markerType <= 0.5) {
140- alpha = clamp(1.0 - pointerTrail * 0.08, 0.7, 1.0);
141- }
142- if (pointerHalo > 0.0) {
143- color = mix(color, vec3(1.0), pointerHalo * 0.7);
128+ if (activeHalo > 0.0) {
129+ color = mix(color, vec3(1.0), activeHalo * 0.5);
144130 }
145- outColor = vec4(color, alpha );
131+ outColor = vec4(color, 1.0 );
146132}
147133`
0 commit comments