{"id":19378673,"url":"https://github.com/aniketrajnish/unity-collider-optimizer","last_synced_at":"2025-04-06T02:11:50.127Z","repository":{"id":197503371,"uuid":"698713082","full_name":"aniketrajnish/Unity-Collider-Optimizer","owner":"aniketrajnish","description":"Optimizes mesh and polygon colliders in Unity","archived":false,"fork":false,"pushed_at":"2024-03-06T07:11:34.000Z","size":2280,"stargazers_count":406,"open_issues_count":1,"forks_count":23,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-30T01:11:10.281Z","etag":null,"topics":["collider","collider2d","game-development","meshcollider","polygoncollider2d","qem","quadric-error-metrics","ramer-douglas-peucker","unity-tool","unity2d","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aniketrajnish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-30T18:24:06.000Z","updated_at":"2025-03-28T10:47:25.000Z","dependencies_parsed_at":"2023-12-11T00:27:39.896Z","dependency_job_id":"4883f591-f971-4bbb-b62f-aa7baf5ee5f6","html_url":"https://github.com/aniketrajnish/Unity-Collider-Optimizer","commit_stats":null,"previous_names":["aniketrajnish/unity-collider-optimizer"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FUnity-Collider-Optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FUnity-Collider-Optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FUnity-Collider-Optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FUnity-Collider-Optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aniketrajnish","download_url":"https://codeload.github.com/aniketrajnish/Unity-Collider-Optimizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collider","collider2d","game-development","meshcollider","polygoncollider2d","qem","quadric-error-metrics","ramer-douglas-peucker","unity-tool","unity2d","unity3d"],"created_at":"2024-11-10T09:06:41.592Z","updated_at":"2025-04-06T02:11:50.105Z","avatar_url":"https://github.com/aniketrajnish.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Collider Optimizer\n\nOptimizes Mesh \u0026 Polygon colliders in Unity.\n\n![placeholder_uco](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/c68a1afb-6501-40c2-a9ac-f7fefd83fed7)\n\n## Polygon Collider Optimizer\n\n| ![PCO_V1](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/62a658c3-487c-4d80-b303-b96a74804a99) | ![PCO_V2](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/cc114920-5bcd-4f06-81ad-9df9a176055d) | ![PCO_V3](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/dfd8c63e-11ed-4a74-a2e1-45e2829f017e) |\n|:---:|:---:|:---:|\n| Original Sprite | Unity Polygon Collider | Optimized Polygon Collider |\n|**Path Count**| *213 paths* | *23 paths* |\n\n\nThe tool uses a [C# implementation](https://www.codeproject.com/Articles/18936/A-C-Implementation-of-Douglas-Peucker-Line-Appro) of the Ramer Douglas Peucker Algorithm to smooth the polylines and reduce the number of paths created by a Polygon Collider in Unity.\n\n#### Performance Comparison\n\nhttps://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/e134f0c6-4c08-4552-b69f-22e7f3b61ebe\n\nYou can run this test on your machine by cloning the project and going to the `Polygon Collider Optimization Test` scene in Unity.\n\n#### Usage\n* Download the `collideroptimizationpackage_2d_v004.unitypackage` package from the [Releases](https://github.com/aniketrajnish/Unity-Collider-Optimizer/releases/).\n* Import all the assets from the package in your unity project.\n* Attach the `PolygonColliderOptimizer.cs` script on your 2D sprite.\n* Adjust the `optimizationFactor` to control the amount of optimzation you need. \n\nhttps://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/74f5bdd1-f5c8-4c44-b745-78211919aae3\n\n## Mesh Collider Optimizer \n\n| ![MCO_V1](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/e23b8db9-c301-41b1-8ef0-31b2216057d6) | ![MCO_V2](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/7a88b61c-2c35-40df-a181-23e7d0d7c05c) | ![MCO_V3](https://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/06a5fb01-3c08-4a1c-bb82-2b30a534693e) |\n|:---:|:---:|:---:|\n| Original Mesh | Unity Mesh Collider | Optimized Mesh Collider |\n|**Triangles Count**| *9132 tris* | *2416 tris* |\n\n\nThe tool uses the [Computational Geometry Unity Library](https://github.com/Habrador/Computational-geometry) by Erik Nordeus 🐐 to perfrom the Quadric Error Metrics simplification on the shared mesh of the mesh collider.\n\n#### Performance Comparison\n\nhttps://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/cfba7837-a81e-4891-9594-501fbf31680f\n\nYou can run this test on your machine by cloning the project and going to the `Mesh Collider Optimization Test` scene in Unity.\n\n#### Usage\n* Download the `collideroptimizationpackage_3d_v004.unitypackage` package from the [Releases](https://github.com/aniketrajnish/Unity-Collider-Optimizer/releases/).\n* Import all the assets from the package in your unity project.\n* Attach the `MeshColliderOptimizer.cs` script on your 2D sprite.\n* Choose the connecting mode between _Fast, Precise, and No._\n* Adjust the `optimizationFactor` to control the amount of optimzation you need.\n* Choose the mesh style to be _Soft, Hard or both_.\n* **Warning: Choosing the \"Fast\" mode would likely lead to errors, Precise mode is recommended for most of the meshes.** \n\nhttps://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/ddb08b48-d241-494c-a6f4-0a822424964a\n\n## Updates\n#### v004\n* Added the functionality to save and load the optimized colliders as assets.\n* Fixed the refresh bug.\n  \nhttps://github.com/aniketrajnish/Unity-Collider-Optimizer/assets/58925008/ba42c61c-4ea1-419d-bf81-324304a218b8\n\n## Contribution\nContributions to the project are welcome. Currently working on converting the QEM algorithm to a coroutine to stop the main Unity thread from freezing.\n\n## Known Bugs\n* ~~If a prefab is made out of a gameobject having Polygon Collider Optimizer, it keeps refreshing itself.~~ **[FIXED]**\n* Choosing Hard Edge Mesh Style decreases the number of triangles but induces additional vertices (doesn't affect the performance).\n\n## License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketrajnish%2Funity-collider-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faniketrajnish%2Funity-collider-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketrajnish%2Funity-collider-optimizer/lists"}