- Home /
Stitching planes
Hi,
basically i have 2 river models that use a custom shader that gives the models sinus waves along the mesh.
Now the problem is when i have 2 models next to eachother they are not "synced" so the two ends don't go with eachother
Is there a way to fix this in the shader or via script ?
This is the vertex part of the shader for information purposes:
half3 vertexOffsetObjectSpace(appdata_full v) {
return v.normal.xyz * sin((length(v.vertex.zy) + _Time.w * _DisSpeed )*_DisplacementTiling) * _Displacement * 1.5;
}
v2f_aniOnly vert_onlyAnimation(inout appdata_full v)
{
v2f_aniOnly o;
v.vertex.xyz += vertexOffsetObjectSpace(v);
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
return o;
}
Thanks in advance !
You could attach the two river models in your 3d software program, then make sure the UVW's line up so that a seamless texture can tile without any noticeable lines. Collapse it, detach the polys of one from the other then re-import them back to unity. As long as the edges are sitting tangent to one another they should appear seamless. It would depend on your exact set up and how your shader functions... just an idea though.
thanks , i edited the question with part of the shader code.
Basically it is terrain that is splitted into square tiles. Some tiles have a river running thorugh it , what i can do is make the river one model over the whole terrain but that could be very expensive so they will be splitted.