- Home /
Better tessellation collision
Hi everyone,
I have a cube which uses a tessellation material and changes the shape of a sphere. The new shape of the sphere does not react on collisions, just the old sphere is still colliding. Even if I add a mesh collider Its not working, its like there is just the sphere. But I want the real tessellated object to collide. How can I do that?
You need to update the sphere collider. Increase the radius to reflect the new size that the collider needs to be :
Thats not what I meant. I did changed the sphere collider size, but I dont want it to be round! The tessellation material gives the sphere another mesh, I want a collider for that "new" tessellated mesh.
Answer by Graham-Dunnett · May 07, 2013 at 08:05 PM
You will need to build a mesh collider and update that to reflect the shape that the tessellation creates.
As mentioned it is still a sphere. You mean manually building the mesh collider? That would be too much work for too many meshes. Is there a way to auto-generate it (I know there is for imported meshes)
its not too much work. you can create the collider mesh in a modeling program by using the same heightmap used on the shader. You will have to match the heights of each to get a relatively accurate collision. I would also try to keep the displaced mesh collider fairly low poly, as a totally accurate calculation of the heightmap would crush the engine. Since there is no real mesh data co$$anonymous$$g from the shader itself, you can not 'auto-generate'. The tessellation is essentially an illusion, wherein the model it is applied to is the actual shape of the object.
Thanks, did not think of using the heightmap as template for the collision mesh.