30
2014
[Asset Store] PolygonCollider2D Optimizer
Small tool for sprite PolygonCollider2D optimization (got tired of manually adjusting sprite collider vertices when doing this small ‘game’ for android)
*Main image fruit credit: Fi3uR (CC BY-NC-ND 3.0)
Asset Store Link: https://assetstore.unity.com/packages/tools/sprite-management/polygoncollider2d-optimizer-16605?aid=1101lGti
Unity Forum Link: http://forum.unity3d.com/threads/240534-Released-PolygonCollider2D-Optimizer
Documentation:
PolygonCollider2D_Optimizer_web.pdf
Features:
– Super simple workflow, real results! (increased frame rate, no more “floating colliders”)
– Optimize, Scale, Move, Filter/Remove PolygonCollider2D vertices & paths (for every selected sprite)
– Remove inner paths, Keep only largest path, Remove paths based on vertex count
– Add, Reset, Remove PolygonCollider2D’s (for every selected sprite)
– 4 Scaling modes: Estimate Neighbours, Standard Scaling, Normalized Scaling, Normalized Scaling (local center). *Scaling is useful for avoiding Box2D skin margin problems
Limitations:
– This uses unity generated PolygonCollider2D’s, its not reading the image data at all, those generated polygoncolliders are then optimized
– Not all actions are undoable (see docs), but you can always reset collider to unity
Roadmap/Future ideas:
– feel free to suggest!
Basic Tutorials
“Remove Inner Paths & Optimize”
-Start optimizer from Window / PolygonCollider2D Optimizer
– Select some sprite with PolygonCollider2D from scene (you should see in the optimizer window how many paths & vertices the collider has)
– Click “Remove inner paths” few times (until all inner paths are removed) / alternatively you could click “Keep biggest path only”
– Set Filter angle to 18 or so (seems good value in most cases)
– Click Optimize (you can click Optimize again, just incase some edge went below this angle on first round)
– And you are done!
Webplayer demos:
Non-Optimized Scene: http://unitycoder.com/upload/demos/PolygonCollider2D_Optimizer_unity_non_optimized1/
Optimized Scene: http://unitycoder.com/upload/demos/PolygonCollider2D_Optimizer_unity_optimized1/
Android .APK demos:
Non-Optimized Scene: MediaFire | DropBox
Optimized Scene: MediaFire | DropBox
—
Before & After (easy to remove holes)
—
user interface:
—
non-optimized scene: (starts to slowdown after 350+ sprites with default polygon colliders)
—
Optimized scene: (still running nicely at 600 optimized sprites, starts to dip below 40-50 at ~700 sprites)
* (optimizing workflow: select all objects, click Optimize couple times, click Remove inner paths 3-4 times, click scale twice – Done!)
—
Before scaling (default PolyCollider2D by Unity) || After optimizing & scaling:
—
Before and after optimizing (could had scaled it a bit after optimizing though)
Related Posts
6 Comments + Add Comment
Leave a comment
Recent posts
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on
Its alive: http://u3d.as/content/mgear/polygon-collider2d-optimizer
fantastic!
1 Bonus tool will be added to the package soon, more info here:
http://forum.unity3d.com/threads/released-polygoncollider2d-optimizer.240534/#post-1667020
I want to ask question. I buy this but ı cant use. Icant run editor script? how can run it ?
New menu item should appear at Window/PolygonCollider2DOptimizer
uploaded to store with Unity 5.1 just now