- Home /
Too subjective and argumentative
How do I update the collider mesh based on the shader vertex deformed mesh?
I'm deforming a plane mesh by adjusting vertex positions within a shader. How would I update the collider mesh vertex positions based upon the shader deformations.
I've already tried to grab the new mesh during runtime and feeding it to sharedMesh, but the mesh on the object is not actually deformed, of course, it's only visually displaced using the shader.
Ideas?
Short answer? You can't. Possibly rethink what you are really trying to do here- even if you could do this it would incur a massive performance overhead from submitting a new mesh to physics every frame.
It's for intial terrain generation, so the mesh would only need to be updated once. Not every frame. :P
And if you could possibly give me the long answer of why I can't achieve this, I'd be grateful.
this is essentially the same problem I have - did you ever get it figured out?