Skip to content

Instantly share code, notes, and snippets.

@ufna
ufna / plexus.hlsl
Created January 21, 2020 12:36
Plexus Particles for Unreal Engine 4 (based on work of eclmist)
struct Functions
{
float distLine(float2 p, float2 a, float2 b) {
float2 ap = p - a;
float2 ab = b - a;
float aDotB = clamp(dot(ap, ab) / dot(ab, ab), 0.0, 1.0);
return length(ap - ab * aDotB);
}
float drawLine(float2 uv, float2 a, float2 b) {