Publisher | Iggy Zuk |
---|---|
File size | 1.33MB |
Number of files | 21 |
Latest version | 1 |
Latest release date | 2018-09-28 10:36:08 |
First release date | 2018-09-26 06:30:10 |
Supported Unity versions | 2018.4.2 or higher |
A simple shader that creates an outline around a sprite.
Pros:
● Creates an outline!
● Single-pass
● Transparency
● No alterations to the texture
Cons:
● No dynamic batching - object space transformations
● Doesn't work in canvas, because of dynamic batching
How to use:
Add the Outline component to a game object with a SpriteRenderer.
How it works:
Vertex shader extends the vertices outwards while the texture stays in the center allowing space for the outline.
Dynamic batching is disabled because when the mesh is batched the vertices will be scaled up from center of the world instead of the center of the sprite.
Future improvements:
Get it to work with dynamic batching, and canvas. May be possible to pass extra data per vertex to preserve the original positions.