Original Post
I'm currently trying to generate procedural terrain from instanced cubes and I'm running into a serious problem: there are sporadic ugly seams between the instanced cubes. As far as I can tell, this is a floating point problem. But I have no idea how to fix it.
My vertex shader is quite simple, and takes input data in the form of bytes to generate the Position of the vertex.
Any ideas on how I can get rid of the seams?
My vertex shader is quite simple, and takes input data in the form of bytes to generate the Position of the vertex.
// CALCULATE THE WORLD POSITION.
float4 position = float4(
(ChunkXLoc * 16.0f + input.CubeData.x + input.ChunkData.x) * 30,
(input.CubeData.y + input.ChunkData.y) * 30,
(ChunkZLoc * 16.0f + input.CubeData.z + input.ChunkData.z) * 30,
1.0f);
// TRANSFORM WORLD POSITION TO SCREEN SPACE.
output.Position = mul(position, ViewProj);
Any ideas on how I can get rid of the seams?