Shereen Lee commited on
Commit
757753c
·
1 Parent(s): ca3ba2c

feat(cesium): ease off the watercolour vibrance + softer buildings

Browse files

- post-process: add a luminance desaturate (~28%) and soften the posterize from
6 to 8 levels (+ lighter edge darkening) so the globe reads less aggressively
- OSM buildings: lower wash opacity and add a height band so towers blend into
the painterly map as translucent forms instead of solid colour blocks

Files changed (1) hide show
  1. index.html +11 -6
index.html CHANGED
@@ -4832,10 +4832,13 @@
4832
  defines: { h: "${feature['cesium#estimatedHeight']}" },
4833
  color: {
4834
  conditions: [
4835
- ["${h} >= 120", "color('" + c[0] + "', 0.85)"],
4836
- ["${h} >= 60", "color('" + c[1] + "', 0.8)"],
4837
- ["${h} >= 25", "color('" + c[2] + "', 0.78)"],
4838
- ["true", "color('" + c[3] + "', 0.7)"],
 
 
 
4839
  ],
4840
  },
4841
  });
@@ -4961,12 +4964,14 @@
4961
  void main() {
4962
  vec2 uv = v_textureCoordinates;
4963
  vec3 c = texture(colorTexture, uv).rgb;
4964
- c = floor(c * 6.0 + 0.5) / 6.0; // flat washes
 
 
4965
  float o = 1.0 / 1024.0;
4966
  vec3 dx = texture(colorTexture, uv+vec2(o,0.)).rgb - texture(colorTexture, uv-vec2(o,0.)).rgb;
4967
  vec3 dy = texture(colorTexture, uv+vec2(0.,o)).rgb - texture(colorTexture, uv-vec2(0.,o)).rgb;
4968
  float edge = clamp(length(dx)+length(dy), 0.0, 1.0);
4969
- out_FragColor = vec4(c * (1.0 - 0.35*edge), 1.0);
4970
  }`,
4971
  }));
4972
  } catch (e) { console.warn("[cesium] watercolor post-process failed", e); }
 
4832
  defines: { h: "${feature['cesium#estimatedHeight']}" },
4833
  color: {
4834
  conditions: [
4835
+ // softer, more translucent washes so towers read as painted forms
4836
+ // that blend with the map rather than solid colour blocks
4837
+ ["${h} >= 140", "color('" + c[0] + "', 0.72)"],
4838
+ ["${h} >= 80", "color('" + c[1] + "', 0.66)"],
4839
+ ["${h} >= 45", "color('" + c[2] + "', 0.6)"],
4840
+ ["${h} >= 20", "color('" + c[2] + "', 0.54)"],
4841
+ ["true", "color('" + c[3] + "', 0.48)"],
4842
  ],
4843
  },
4844
  });
 
4964
  void main() {
4965
  vec2 uv = v_textureCoordinates;
4966
  vec3 c = texture(colorTexture, uv).rgb;
4967
+ c = floor(c * 8.0 + 0.5) / 8.0; // softer washes (was 6 - less flat)
4968
+ float luma = dot(c, vec3(0.299, 0.587, 0.114));
4969
+ c = mix(vec3(luma), c, 0.72); // ease off the vibrance (~28% desaturate)
4970
  float o = 1.0 / 1024.0;
4971
  vec3 dx = texture(colorTexture, uv+vec2(o,0.)).rgb - texture(colorTexture, uv-vec2(o,0.)).rgb;
4972
  vec3 dy = texture(colorTexture, uv+vec2(0.,o)).rgb - texture(colorTexture, uv-vec2(0.,o)).rgb;
4973
  float edge = clamp(length(dx)+length(dy), 0.0, 1.0);
4974
+ out_FragColor = vec4(c * (1.0 - 0.3*edge), 1.0);
4975
  }`,
4976
  }));
4977
  } catch (e) { console.warn("[cesium] watercolor post-process failed", e); }