Last modified: 2025-06-03 10:45:02
< 2025-05-27 2025-06-04 >With o3's masked clones thing we make blends like this:
I'm wondering what happens if we do the thing about weighting the blend radius by the dot product of the surface normals.
Meh, no good.
That comes from multiplying the blend radius by 1 - abs(dot(n1,n2))
.
It does remove some of the excess blend material, but it leaves a discontinuous field and it doesn't remove all of it.
How hard would it be to make an interactive map that lets you drag a slider to see what land would have been exposed in the past if sea levels were lower?
From a quick play with Cursor it looks like while MapLibreGL can read terrain data and let you query it with JavaScript, it doesn't have an efficient way to let you change fill colour based on elevation.
So do I maybe want a custom tile server? It would maybe proxy to the normal tile servers, except colour the map tiles based on a user-supplied elevation.
Is there a better way to do it with vector tiles?
ChatGPT suggests you can make a custom WebGL layer to fill based on elevation?
I can't work out how to let a WebGL layer access the texture containing elevation data.
I think a custom tile server might be the easiest way.
The "raster-dem" format stores elevation as
elevation = (Red * 256 + Green + Blue / 256) - 32768
Where elevation
is in metres.
And the URLs are like .../{z}/{x}/{y}
where:
z = 0
is the whole world in a single 256x256 tile, increases in z
double the number of tiles in both directionsx
and y
are tile indices (0 to 2^z-1)Interestingly this means it has no way to represent areas within 5 degrees of the poles. I wonder if I want something else.
Maybe https://cesium.com/platform/cesiumjs/ actually is a better choice this time? No, looks too complicated.
OK, how do vector tiles work? I could make a vector tile server that only returns polygons that cover the sea. Can I just return an SVG? Apparently the format is "Mapbox Vector Tile" https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/
Meh, vector tiles are too much hassle. I'll just proxy to the upstream raster-dem
tile and make it transparent
where it's above land and solid blue where it's under water.
OK, this is working, which is cool... but the AWS tile server is really slow to respond, even when I can see hillshading appear much more quickly than my sea levels, and my image processing basically takes 0 time. How does Firefox fetch the tiles so much faster than my proxy? Is it deliberately slow to non-web-browsers?
< 2025-05-27 2025-06-04 >