I was able to change the shape of a box with Vertex in the shader
And with changes in the mesh, I was able to change the shape of the box
What is the difference between changing the box by changing the mesh and changing the vertex in the shader?
That’s a very good question:
Changing the mesh in a vertex shader involves updating its position and other properties (e.g. UV coordinates, normals etc) per vertex in the shader.
The 1st scenario is taxing the CPU, the 2nd one the GPU. The GPU usually is way faster in this kind of operation but it comes down to what you are trying to do.
Are you updating the mesh once or at least a few times and you are also using it as a trimesh collider? You can only go with the 1st scenario, since physics need access to the mesh (it needs to live in RAM in addition, not only in the GPU memory).
Are you updating the mesh per frame e.g. doing a nice vertex animation? Definitely do it in the GPU (2nd case), it’s much faster and performance will not suffer (unless you are animating A LOT of vertices per frame).
Hope that helps as a starting point.