How to add a MeshCollider to a plane that has been modified with a shader displacement map
I have a simple plane. I have written a shader that uses a heightmap to displace the vertices. This produces the desired visual effect. However I can't seem to generate a MeshCollider for it. As the vertex modification has happened in the shader, the MeshFilter.mesh is the mesh of the original flat plane. What I'd like to do is extract the vertex information from the shader post-displacement (in order to create a new mesh and use that as the collider) but I'm not sure how to do this, or if it's even possible. It is apparent in the editor that Unity is "aware" of the vertex locations, as there is an overlay of the triangles of the mesh (see below). I just don't know how to get at this information.
Any help is MUCH appreciated! Thanks in advance!
Answer by deadlycrow · Jun 01, 2017 at 06:28 PM
bump!... Trying to acomplish the same here... no one knows this?