From ffb3a21f18823d7e0d649b390c9a11576c04cb92 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2026 01:12:51 +0530 Subject: Add vase --- src/main/resources/shaders/modules/utils.glsl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/resources/shaders/modules/utils.glsl') 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; -- cgit v1.3.1