lygia/sdf/superShapeSDF)It returns a supershape, which is a mathematical function for modelling natural forms develop by Paul Bourke and Johan Gielis. Some notes about the parameters:
* `m` determines number of sides/branches
* `m = 0` yields a circle
* `a!=b` results in an asymmetrical shape
* `n1=n2=n3<1` the shape is "pinched"
* `n1>n2,n3` the shape is "bloated"
* `n1!=n2!=n3` the shape is asymmetrical
* `n1=n2=n3=1` the shape is a square
* `n1=n2=n3=2` the shape is a star
For more information about the supershape, check this article by Algosome.
Dependencies:
lygia/space/cart2polar.glslUse:
<float> supershapeSDF(<vec2> st, <vec2> center, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)
<float> supershapeSDF(<vec2> st, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)
Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! ↩
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.) ↩
Dependencies:
lygia/space/cart2polar.glslUse:
<float> supershapeSDF(<float2> st, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)
Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! ↩
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.) ↩
Dependencies:
lygia/space/cart2polar.glslUse:
<float> supershapeSDF(<float2> st, <float2> center, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)
<float> supershapeSDF(<float2> st, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)
Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! ↩
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.) ↩
Dependencies:
lygia/space/cart2polar.glslLygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! ↩
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.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository
Lygia functions are small and self-contained. You can just copy, paste and edit them into your app if you prefer doing things manually! ↩
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.) ↩