I think I should structure this question better.
My terrain consists inI'm developing a serie ofprocedural terrain structured with voxel chunks procedurally generated. I then connect surface voxels to create meshes. Since it
Every chunk:
- contains a NxNxN voxel array generated with perlin noise 3d
- contains a Mesh derived from the surface points of the voxel array
- is rendered with marching cubes algoritm
Every mesh has its own Material
Every Material is all dynamic I cannot workmade of 3 texture: one main texture and 2 minor textures to be blended with the main one depending on blending via the unity editor andslope. Every material has its own shader attached.
So I have to do alla terrain made of a certain number of chunks, that are a certain number of meshes generated as the work via scripts and shadersgame launches.
In Inside every chunk blending if okay, since I have the following picture you can seeonly material for the result achieved atcurrent mesh I have only to blend its textures depending on heights - and this is done by the momentshader.
In this attached image

as you can noticesee quite clearly what I acheived until now. As you can see, the areaeverything is mostly divided into squares (which actuallyin "squares", which are cubes with a mesh inside)the meshes. For everyEach square is dynamically randomly assignedhas a Materialtexture green or beige (grass or sand). Both material are for simplicity going with 3 textures
My concern is that: the main texture (grass or sand) and rock and gravel which are used to blend the When passing from grass (orto sand) depending on the slope.
As shown in the picture there is no blending, i.e. blending among textures (grass -> gravel -> rock or sand -> gravel -> rock)between 2 meshes is performed nicelymy real problem, although this works onlybecause inside a singlethe shader if have the surf function which iterates over all the input vertices. But those vertices are only from one mesh.
Nevertheless I don't know how to have a smooth passage when To blend correctly I crosswould need informations also about the vertices of the mesh having 2 different material one next to anothernearby.
TheSo the question could look likeis: how can I have a smooth passage between 2 different materials, knowing that thoseblend properly materials don't belongbelonging to the same meshdifferent meshes?