Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EmmetOT/LineDrawer
A simple tool for drawing anti-aliased lines in Unity, similar to Handles.DrawAAPolyLine but not a gizmo.
https://github.com/EmmetOT/LineDrawer
lines rendering shaders unity unity-editor unity-editor-gui unity3d unity3d-plugin
Last synced: about 1 month ago
JSON representation
A simple tool for drawing anti-aliased lines in Unity, similar to Handles.DrawAAPolyLine but not a gizmo.
- Host: GitHub
- URL: https://github.com/EmmetOT/LineDrawer
- Owner: EmmetOT
- License: mit
- Created: 2021-06-28T21:02:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-07T22:15:18.000Z (over 3 years ago)
- Last Synced: 2024-08-02T05:13:18.732Z (5 months ago)
- Topics: lines, rendering, shaders, unity, unity-editor, unity-editor-gui, unity3d, unity3d-plugin
- Language: C#
- Homepage:
- Size: 35.2 KB
- Stars: 47
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LineDrawer
A simple tool for drawing anti-aliased lines in Unity. Written in Unity version 2019.4.11 with URP, though it wouldn't be hard to alter this for use with HDRP or the build-in render pipeline.I made this because I wanted to reproduce the functionality of Handles.DrawAAPolyLine but not just in Gizmos. Unity's LineRenderer is not really any good to me: I find it cumbersome and it doesn't render at a consistent width in screen space.
This tool has a very straightforward API, you can add, remove, or adjust points at will. Each point has its own position, width, and colour, with the values interpolated between them. This is achieved using signed distances fields and a Graphics.DrawMesh call. It should work just fine with instancing, too.
This could be handy for UI or simple effects! The shader is very straightforward so you could mess around with it to make even cooler effects, too.
![lineDrawer](https://user-images.githubusercontent.com/18707147/123711084-c697cb80-d867-11eb-939c-06056db5f1ff.gif)
![gravity1](https://user-images.githubusercontent.com/18707147/123711122-d6afab00-d867-11eb-8b6f-002dc0c94c61.gif)