You're gonna have trouble with bilinear (gets worse with trilinear) filtering at the edges because the GPU should be interpolating between the two textures, but obviously this won't happen, so you need to do it yourself.
Potentially you may have to sample all four textures and interpolate it yourself:
// Assuming layout of textures: // |0|1| // |2|3| result = mix( mix( c0, c1, fract( uv.x * 1024.0 - 0.5/1024.0 ), mix( c2, c3, fract( uv.x * 1024.0 - 0.5/1024.0 ), fract( uv.y * 1024.0 - 0.5/1024.0 ) );
If you're at the left/right edge, you only need c0 & c1 or c2 & c3; if you're at the top/bottom edge you only need c0 & c2 or c1 & c3. But if you're close to the cross intersection, you're going to need to sample and mix all 4 textures.
Also the mipmaps need to be generated offline based on the original 1024x1024 rather than generating them on the GPU since it will generate them based on the 512x512 blocks individually.
I can't think quickly of a way to fix the trilinear filtering problem though.