I mentioned before that due to bilinear filtering that I was getting seams appearing between the charts that made up the terrain texture.
I tried to solve this using the ID3DXTextureGutterHelper API. Despite the fact that it is reasonably simple looking, I couldn't get it to do anything useful.
Consequently I implemented a "jittered" RTT solution. This gets rid of the obvious bilinear filtering errors. However it's caused some other quite subtle errors... [headshake]
Mip-Mapping screws it all up.
In the above image you can see three pink lines running across the terrain (the black/white parts are intentionally part of the texture). This is curious because, in the following image they're gone:
I've accentuated the seams by using the "creases" mode in MeshViewer as well as highlighting the orange lines using PSP. There are no pink/magenta bilinear filtering issues.
Quite quickly I realised what the issue was.
In the first image, things are "zoomed" out to such an extent that D3D is automagically picking a lower mip-level than the top one. Lower mip-levels are just a resized version of the top one. This seemingly re-introduces the bilinear filtering errors.
If, as in the second image, I zoom in sufficiently such that D3D picks the highest (normal) mip-level then the "jitter" correction I applied kicks in and there are no errors in the rendered display.
So, the obvious solution now is that instead of saving the results of my editor to a regular BMP and letting D3DX load and auto-gen the mip's, I need to get the editor to render every mip-level manually, and then save it out as a DDS. Fun.