[go: up one dir, main page]

LYGIA Shader Library

linkSDF (lygia/sdf/linkSDF)

generate the SDF of a link

Use:

<float> linkSDF( <vec3> p, <float> le, <float> r1, <float> r2 )

Check it on Github


  1. Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! 

  2. Lygia currently hosts two versions of WebGPU shaders. The newer versions use the WESL language and have a .wesl suffix. For new Lygia users, we recommend .wesl. (The older versions use a .wgsl suffix, but are less complete and use a custom #include syntax.) 

Use:

<float> linkSDF( <float3> p, <float> le, <float> r1, <float> r2 )

Check it on Github


  1. Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! 

  2. Lygia currently hosts two versions of WebGPU shaders. The newer versions use the WESL language and have a .wesl suffix. For new Lygia users, we recommend .wesl. (The older versions use a .wgsl suffix, but are less complete and use a custom #include syntax.) 

Use:

<float> linkSDF( <float3> p, <float> le, <float> r1, <float> r2 )

Check it on Github


  1. Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! 

  2. Lygia currently hosts two versions of WebGPU shaders. The newer versions use the WESL language and have a .wesl suffix. For new Lygia users, we recommend .wesl. (The older versions use a .wgsl suffix, but are less complete and use a custom #include syntax.) 

Check it on Github


  1. Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! 

  2. Lygia currently hosts two versions of WebGPU shaders. The newer versions use the WESL language and have a .wesl suffix. For new Lygia users, we recommend .wesl. (The older versions use a .wgsl suffix, but are less complete and use a custom #include syntax.) 

LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors, created and lead by Patricio Gonzalez Vivo.

Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).

It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.

Get the latest news and releases

Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository


  1. Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! 

  2. Lygia currently hosts two versions of WebGPU shaders. The newer versions use the WESL language and have a .wesl suffix. For new Lygia users, we recommend .wesl. (The older versions use a .wgsl suffix, but are less complete and use a custom #include syntax.)