diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-10-09 01:12:51 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-10-09 01:12:51 +0530 |
| commit | ffb3a21f18823d7e0d649b390c9a11576c04cb92 (patch) | |
| tree | 38e544f7f889f1d0bac1d77474fe4c433b29d8e1 /src/main/resources/shaders/modules/utils.glsl | |
| parent | 56a6b43ec8509012755c9d63608fb98155b52a9a (diff) | |
| download | art-playground-openrndr-ffb3a21f18823d7e0d649b390c9a11576c04cb92.tar.gz art-playground-openrndr-ffb3a21f18823d7e0d649b390c9a11576c04cb92.zip | |
Add vase
Diffstat (limited to '')
| -rw-r--r-- | src/main/resources/shaders/modules/utils.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/resources/shaders/modules/utils.glsl b/src/main/resources/shaders/modules/utils.glsl index 961480f..090e017 100644 --- a/src/main/resources/shaders/modules/utils.glsl +++ b/src/main/resources/shaders/modules/utils.glsl @@ -9,6 +9,16 @@ float ssubtract(float a, float b, float k) { return -smin(-a, b, k); } +float rotational_repetition(vec2 p, int n, inout vec2 p1, inout vec2 p2) { + float del = 2. * PI / float(n); + float theta = atan(p.y, p.x); + float id = floor(theta / del); + float id2 = id + 1.; + p1 = mat2(cos(del * id), -sin(del * id), sin(del * id), cos(del * id)) * p; + p2 = mat2(cos(del * id2), -sin(del * id2), sin(del * id2), cos(del * id2)) * p; + return id; +} + // Easing float ease_in_out_quart(in float x) { return x < 0.5 ? 8 * x * x * x * x : 1 - pow(-2 * x + 2, 4) / 2; |
