FastLED
3.9.15
Loading...
Searching...
No Matches
◆
grad()
[3/4]
static int32_t grad
(
uint8_t
hash
,
int32_t
x
,
int32_t
y
,
int32_t
z
)
static
Definition at line
90
of file
simplex.cpp
.
90
{
91
int32_t h =
hash
& 15;
// Convert low 4 bits of hash code into 12 simple
92
int32_t u = h < 8 ?
x
:
y
;
// gradient directions, and compute dot product.
93
int32_t v = h < 4 ?
y
: (h == 12 || h == 14 ?
x
:
z
);
// Fix repeats at h = 12 to 15
94
return
((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v);
95
}
y
int y
Definition
simple.h:93
x
int x
Definition
simple.h:92
z
uint32_t z[NUM_LAYERS]
Definition
Fire2023.h:94
fl::anonymous_namespace{noise_woryley.cpp}::hash
u16 hash(i32 x, i32 y)
Definition
noise_woryley.cpp:18
References
x
,
y
, and
z
.
simplex.cpp
Generated on Fri Aug 22 2025 20:59:34 for FastLED by
1.13.2