A Unity package for drawing object lines in screen space.
- The mesh is likely to change every frame, so delete the mesh generation step.
- Vertex shaders can use ComputeBufers, which allows them to look ahead/behind in a line path sequence.
- Calculating data sequentially on the CPU is slower than in parallel on the GPU, so do the equivalent to mesh generation in the vertex shader.
- Main thread time in unity is minimized. Only updated lines data needs to be copied.
- The transfer process is pushed down to Unity C++ level, out of managed code.
- Needs to be driven by a DrawProcedural call.
- Vertex shader is more expensive, which is a disadvantage on static lines.
Credit to devOdico/GoodLines for pulling together the necessary vertex math, which is in turn based on Drawing Lines is Hard.
Thank you to various commenters in this libcinder forum thread.
LICENSE: MIT