I've recently been experimenting with terra (It's great by the way!) in my project. I'm trying to build a large, streamable world, including terrain. In order to achieve this I'm splitting the world into 'chunks', and tiling them together. My problem is that when I try and tile terrain together, I get noticable gaps between the terrains.

It seems to me that the terrain isn't stretching all the way.
To illustrate this I placed a cube mesh at where I expect the starting corner of the terrain to be.

The red box shows where I expect the terrain to reach to, but for whatever reason it seems to miss this by a tiny margin. The top left corner of the terrain lies exactly on the mesh, but the bottom right corner doesn't stretch far enough.
Each terrain is a single instance of terra, which I create upfront in a pool and recycle as the player moves around. In the example above each terrain is 100x100 in size, and I tile them based on this (so 00 is placed at 0, 0 and 10 is 100,0). The origin of the terrain is the middle of the chunk.
I've tried:
- Using different resolution for the terrains (256, 1024 verticies). Often times a higher resolution terrain will shrink the gap a bit, but not remove it.
- Using different world sizes for the chunks, including prime numbers.
- Reading and altering parts of the terra vertex shader to try and understand where the issue is coming from. I didn't get very far with that.
I create my terrain like this:
Code: Select all
const Ogre::Real terrainSize = 1024.0f;
const Ogre::Real halfSize = terrainSize / 2;
mTerra->load( "flat.png", Ogre::Vector3( halfSize, 0, halfSize ), Ogre::Vector3( terrainSize, terrainSize, terrainSize ) );
This is ogre 2.1, linux, OpenGL.
I'd be really greatful if someone could provide some insight into what this might be.
I don't have that much experience with terrain, so if I've gone completely the wrong way around doing seamless terrain please let me know

Thanks!