diff options
author | Charlie Jolly <charlie> | 2021-10-15 17:27:16 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2021-10-15 17:28:20 +0300 |
commit | 104887800c0f221fbcffa84bb360dd9ff001d7f1 (patch) | |
tree | 743a308c6eda1918e4e97df0d8ba32b7046bedf7 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | 6e4ab5b761b03b52177985ecbeb2c2f576159c74 (diff) |
Geometry Nodes: Add Voronoi Texture
Port shader Voronoi to GN
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D12725
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 8be066bb0e9..bb32b511005 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -1145,6 +1145,19 @@ MINLINE float len_v3v3(const float a[3], const float b[3]) return len_v3(d); } +MINLINE float len_v4(const float a[4]) +{ + return sqrtf(dot_v4v4(a, a)); +} + +MINLINE float len_v4v4(const float a[4], const float b[4]) +{ + float d[4]; + + sub_v4_v4v4(d, b, a); + return len_v4(d); +} + /** * \note any vectors containing `nan` will be zeroed out. */ |