terrain stitching

I’m trying to stitch a couple 513X513 GeoMip terrains and what happens is that in low places along the edges it will form a peak ridge a little higher than where the edges meet, and where the edges meet at higher (hilly) places, it joins with an inverted peak going into the ground. Is this normal or does someone know what I’m doing wrong. My terrains are done with bruteforce and have the same block size and I call set_border_stitching(true) before generate.

thanks for any help

Hmm, that’s not supposed to happen. Can you show a screenshot of this happening?

Also, make sure to check that your heightfield images don’t have a 1 pixel border on one of the sides.

Thanks for the reply.

I used L3DT(free ver) to make a 1024x1024 terrain, then took the .png height map and .jpg texture map into Gimp where I used 50% horiz and vert guide lines and guillotine to cut out 512x512 tiles, then sized them to 513x513 (maybe this process does something bad…)

Here is the before stitch image:

and the after stitching image:

I think that it’s just that the heightmaps don’t line up perfectly. Remember that the 513th column must match the first column of the next image, same goes for the other axis.

Take the 1024x1024 image, and crop to a 513x513 area in all of the four corners. This way, one row of pixels in the middle will always overlap.

Yeah, that’s probably it, I might need to do the cuts differently, than auto 50% method. I can do specified crops in L3DT, a little more work though. I’ll play with it and see what happens.

Thanks for the help

well, things are looking a little better in a way. I made sure of overlapping my crops as I made the 513x513 (using IrfanView this time). My unstitched terrains will fit together with no gap, but with color in the seam, but when I do the stitch it still wants to make a wedge that looks like it tries to maintain a certain height, and so it will be poking above ground in some places and level to ground in others and also under ground in others, depending on the terrain hills and valleys.

new pics:

no stitching

stitched

I was wondering about that texture color seam, looked like pixels from the opposite ends getting flipped or something. Thought to try calling the texture UV wrapping calls set_wrap_u and set_wrap_v with “clamp”, and it worked, no more funny color pixels at the edges of my terrain.

    PT(Texture) groundTexture = TexturePool::load_texture(textureFile); 
    groundTexture->set_wrap_u(Texture::WrapMode::WM_clamp);
    groundTexture->set_wrap_v(Texture::WrapMode::WM_clamp);
    tnode.set_texture(groundTexture, 1);

here’s before and after shots…

without U V clamp

with U V clamp