summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-09-28 01:46:34 -0700
committeryum <yum.food.vr@gmail.com>2024-09-28 01:46:34 -0700
commitdb11ed0901600e316ac54c2e2d8fdeec46c8af68 (patch)
tree04d796108edbbd3594b97c8e7889c76affcba103 /math.cginc
parent7842e7db948fb46b17afa0ccc63a8807b2269b6c (diff)
Add letter grid gimmick
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc10
1 files changed, 10 insertions, 0 deletions
diff --git a/math.cginc b/math.cginc
index 8938940..fd5dda0 100644
--- a/math.cginc
+++ b/math.cginc
@@ -113,5 +113,15 @@ float fbm(float3 p, const int n_octaves, float w)
return res;
}
+float median(float x, float y, float z)
+{
+ return max(min(x, y), min(max(x, y), z));
+}
+
+float median(float3 x)
+{
+ return median(x.x, x.y, x.z);
+}
+
#endif // __MATH_INC