I am trying to make it so my displacement used with tessellation will scale with the texture mapping scale in global space. That is, if the texture is stretched across a big surface, the amplitude of the displacement should be bigger to match. Without this, the displacement can look flat or tall and skinny depending on the scale of the texture mapping. You can see in the shot below, the displacement is larger when the texture is spread across a bigger area, so the correct shape is preserved.
My first attempt was to calculate this in the tessellation evaluation shader, based on the edge lengths (position) divided by the edge length in texcoords. This works fine for flat surfaces like the shot above, but will produce cracks for curved surfaces like a sphere, where there is not a constant texture density.
My second attempt was to calculate this on the CPU and store it as a vertex attribute. This was a lot better, but some cracks are still visible. My vertex texture scale values are calculated as the average of all edges that vertex is part of, and it is not surprising there are some small differences.
Is there any other technique I should think about? The only thing that seems like it would work for curved geometry is to just calculate an average texture mapping scale, and apply that to the whole mesh.