How to create a procedural line from point A to point B with custom thickness value?

Hi, so I want to learn how to create a procedural line where i can type the vec2 coordinate of point A (start) and the vec2 coordinate of point B (target) for the line (not endless line like in SDF Line patch), and put some thickness value in it.

I tried to follow this method: Shader - Shadertoy BETA
it works for the endless line. even without that, i know multiple ways to create an endless line. What i want to achieve is the segment line. the line from point A to B.

I know i’m so close to figure it out and probably only missing some simple things. please help.

I figured it out! :smiley:


This is the patch:
Line.arp (20.5 KB)

3 Likes

Nice one! Thanks for sharing!

1 Like