summaryrefslogtreecommitdiff
path: root/tangle/LLBM
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-09-19 21:02:52 +0200
committerAdrian Kummerlaender2021-09-19 21:02:52 +0200
commit186bfae321f9d34b702a7c31b420eed4d10e7a50 (patch)
tree4e8e6a691193dd0ce9555d2e29f4414336d17cda /tangle/LLBM
parent32dd41a728ce10113032e20955ba08f8de449857 (diff)
downloadLiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar.gz
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar.bz2
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar.lz
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar.xz
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.tar.zst
LiterateLB-186bfae321f9d34b702a7c31b420eed4d10e7a50.zip
Small changes to channel example
Diffstat (limited to 'tangle/LLBM')
-rw-r--r--tangle/LLBM/sdf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tangle/LLBM/sdf.h b/tangle/LLBM/sdf.h
index 656c109..52db8cf 100644
--- a/tangle/LLBM/sdf.h
+++ b/tangle/LLBM/sdf.h
@@ -63,6 +63,15 @@ __device__ __host__ float sintersect(float a, float b, float k) {
return lerp(b, a, h) + k*h*(1.f-h);
}
+__device__ __host__ float3 twisted(float3 p, float k) {
+ float c = cos(k*p.y);
+ float s = sin(k*p.y);
+ float3 q = make_float3(0,0,p.y);
+ q.x = p.x*c + p.z*-s;
+ q.y = p.x*s + p.z* c;
+ return q;
+}
+
}
template <typename SDF>