Unity-SpriteAssist is an Unity extension that assist Sprite's mesh creation more conveniently.
Unity 2019.4 or later versions
- Dynamic preview
- Make a transparent, opaque, complex(transparent + opaque) mesh
- Convert Sprite to MeshRenderer Prefab
You can add https://github.com/sr4dev/Unity-SpriteAssist.git?path=Assets/SpriteAssist
to Package Manager.
Clone or download this repository and copy Assets/SpriteAssist
folder to your Unity project.
- Select a Sprite asset in the Project window.
- Check the
Enable SpriteAssist
on the Inspector window. - Adjust Mode and parameters.
- Transparent Mesh: Default Mode. Allow alpha pixel.
- Opaque Mesh: Disallow alpha pixel. You can use the mesh for opaque shader.
- Complex: Separate area by alpha.
- Alpha pixel is converted to Transparent Mesh area.
- Non-alpha pixel is converted to Opaque Mesh area.
- To Use Complex mode must be created Mesh Prefab.
- Complex mode dose not override original Sprite mesh.
- Detail: Density and accuracy of the mesh to the Sprite outline.
- Alpha Tolerance: Threshold for transparency considered when generating the outline.
- Detect Holes: Detect holes from outline.
- Edge Smoothing: Smoothing sharp edges.
- Non-zero Winding: Use Non-zero winding rule. Default Winding rule is even-odd.
Even-odd(left), Non-zero(right)
Wikipedia: Non-zero winding
- Prefab: Linked Prefab with Sprite.
- Create/Remove: Create or remove a Prefab.
- Default Transparent Shader
- Default Opaque Shader
This extension uses AssetImporter.userData of Texture asset. If your project already uses userData, it will be overridden.
Unity Document: AssetImporter.userData
MIT License
- Triangulation: LibTessDotNet v1.1.13
- Polygon Clipping: Clipper v6.4.2