GithubHelp home page GithubHelp logo

avatarchik / unity-spriteassist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sr4dev/unity-spriteassist

0.0 0.0 0.0 6.96 MB

Unity Sprite Mesh Extension

Home Page: https://github.com/sr4dev/Unity-SpriteAssist

C# 100.00%

unity-spriteassist's Introduction

Unity-SpriteAssist

image

image

About

Unity-SpriteAssist is an Unity extension that assist Sprite's mesh creation more conveniently.

System Requirements

Unity 2019.4 or later versions

Features

  • Dynamic preview
  • Make a transparent, opaque, complex(transparent + opaque) mesh
  • Convert Sprite to MeshRenderer Prefab

Installation

Unity Package Manager

You can add https://github.com/sr4dev/Unity-SpriteAssist.git?path=Assets/SpriteAssist to Package Manager. image

OpenUPM

https://openupm.com/packages/com.sr4dev.unity-spriteassist/

openupm add com.sr4dev.unity-spriteassist

Manual installation

Clone or download this repository and copy Assets/SpriteAssist folder to your Unity project.

How to use

  • Select a Sprite asset in the Project window.
  • Check the Enable SpriteAssist on the Inspector window.
  • Adjust Mode and parameters.

Mode

image

  • 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.

Parameter

image

  • 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)

image

Wikipedia: Non-zero winding

Mesh Prefab

image

  • Prefab: Linked Prefab with Sprite.
  • Create/Remove: Create or remove a Prefab.
  • Default Transparent Shader
  • Default Opaque Shader

Warning!

userData

This extension uses AssetImporter.userData of Texture asset. If your project already uses userData, it will be overridden.

Unity Document: AssetImporter.userData

License

MIT License

Library

Donation

Buy Me a Coffee at ko-fi.com

unity-spriteassist's People

Contributors

heshuimu avatar park-jungkyu-boi avatar sr4dev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.