Quantcast
Channel: Answers for "Soft edges between two separate meshes - Possible?"
Viewing all articles
Browse latest Browse all 4

Answer by Owen-Reynolds

0
0
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.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images