[go: up one dir, main page]

LYGIA Shader Library

superShapeSDF (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:

Use:

<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)

Check it on Github

Dependencies:

Use:

<float> supershapeSDF(<float2> st, <float> size s, <float> a, <float> b, <float> n1, <float> n2, <float> n3, <float> m)

Check it on Github

Dependencies:

Use:

<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)

Check it on Github

Dependencies:

Check it on Github

Examples

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