Skip to content

A simple tool for drawing anti-aliased lines in Unity, similar to Handles.DrawAAPolyLine but not a gizmo.

License

Notifications You must be signed in to change notification settings

EmmetOT/LineDrawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

gravity1

About

A simple tool for drawing anti-aliased lines in Unity, similar to Handles.DrawAAPolyLine but not a gizmo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published