Soft edges between two separate meshes - Possible?

So I am working on a procedural object that is made up of several separate Gameobjects/meshes of equal dimensions (10x10 planes, in essence). I could have made it one large mesh, but due to processing and rendering constraints I have decided to break it down into “chunks”. Though I haven’t gotten to working on texturing, etc., I imagine that there is going to be a noticeable lighting difference between bordering faces on each chunk. Is there any way around this? Perhaps some fancy shaders? Or is there perhaps a different approach to breaking up a mesh?

~Cheers

That’s pretty much the way terrains are drawn now – a 512x512 array is used to generate lots of adjacent 16x16 meshes. It’s likely you will never see a problem. The main point is, say you have side-by-side chunks A B. Do everything exactly the same for verts on the right side of A as the left-side of B: position, normals, tex-coords, textures … everything. The shader won’t know the difference (normals control lighting – if you use the same on each edge, smooth lighting happens.)

Be sure to use exactly the same data. Copying from the same source is fine. Doing math that should give the same result for each, that will make little holes and discontinuities as rounding errors creep in. Can try an example with Unity planes (they are 10x10 verts.) Lining up two will look fine. But, as you get odd scales/tile-sizes, the ends tend not to match up, even when your math is correct.

For some background: clearly, drawing A with a bumpmap and B without, is going to make a visible seam. What the pros do is make A B C. A has a bump map (or whatever,) B fades it out, and C has none. Making a “fading-out bumpmap” shader is a pain. Likewise, if you want 10x10 near, but 5x5 (twice as large squares) in the distance, B is a special mesh with 10 on the left and 5 on the right, so each pair can share exact vert data on their edge. If you select wireFrame, you can see Unity doing this on terrain – looks like 16x16 pieces.

In general, two meshes can’t have soft edges, since they won’t fit the rule. Placing an Inn on a platform, say. You would need to retesselate the platform to create verts matching the bottom of the inn (or snap the Inn to the platform verts) and then copy that data to the bottom Inn verts, also use the platform texture when you draw the Inn and vice-versa.

Even if this is possible to solve with shader it is not good approach. You will have overlapping geometry with extra vertices which is not advisable in a sense of performance impact and unpredictable behavior. I think that you should make these meshes procedurally. Take a look at this