I think you assume, that I have a global heightmap.
I forgot to say that I this is procedural terrain. The heightdata is generated per Node on the GPU, so no global heightmap data.
Someone might say "Then make the heightmap one pixel larger in every direction" - That dosen"t work either. When the node is on the edge of the cube, I would have to make a 3D heightmap, what would require to know the different side while creating the heightmap and increases the memory consumption by at least 3 times.