Vertex shader and Mesh animation conflict

I have a simple surf + vertex shader for ‘jelly effect’

       void vert (inout appdata_full v) {
          float2 originalPos = v.vertex.xy;
          v.vertex.x += sin (originalPos.y * _Time * 10) * 0.1;
          v.vertex.y += sin (originalPos.x * _Time * 10) * 0.1;
      }

and also on each frame I update vertexes of my mesh to implement ‘blink’ animation

void Update () {
    // update mesh to apply all changes made by MutableMesh
   mutableMesh.Blink(...);
    var meshFilter = GetComponent<MeshFilter> ();
    meshFilter.mesh.vertices = mutableMesh.GetVertexes ().ToArray ();
}

But as a result I have some glitch for vertexes that I actually move, they are shaking (it’s more visible on 1080p):

Do you have some ideas what is the root cause of the problem and how to fix it?

You should consider putting the blink into the shader as well, it’d be faster. if originalPos used worldPosition instead of local it should be safe with the mesh changing underneath it.

Using worldPosition has the same effect.

Your meshes are low poly, but that wiggle code is going to create a quite high frequency spacial noise. That is to say the offset of a vertex will change significantly depending on it’s original position. When you move the mesh vertices via script it’s changing that position. If you try applying your shader to something like the default Unity sphere you’ll probably see the vertices moving much more “randomly” than you might expect. So there’s no real bug here, you’re instead seeing the actual spacial frequency of the wiggle you’re doing as the eye blinks.

Try changing your code from pos * time to pos + time so the position is no longer modifying the period of the wiggle, and only the time offset:

v.vertex.x += sin (originalPos.y + _Time * 10) * 0.1;
v.vertex.y += sin (originalPos.x + _Time * 10) * 0.1;