- Home /
Question by
megafanat · Jan 29 at 04:41 AM ·
2drenderinglinerendererline
LineRenderer: how to draw line intersections?
I need to draw good looking line intersection. Like this:
I understand how to draw such a line with LineRenderer. I should use a custom texture:
But I do not know how to draw good-looking lines intersection without ugly overlapping.
Is it possible to do it in Unity?
intersection.png
(1.3 kB)
texture.png
(604 B)
Comment
Answer by andrew-lukasik · Jan 29 at 11:51 PM
One way of doing this is multi-pass shaders.
Here, for example:
pass #1 draws black fill
pass #2 uses
ZWrite Off BlendOp Max
to mix the the overlapping b&w textures together.
But this is not an universal solution and works fine with very specific grayscale textures. That being said - other variants can be figured out too (given both time and shader knowledge).
screenshot-2022-01-30-004736.gif
(24.9 kB)