FastLED 3.9.15
Loading...
Searching...
No Matches

◆ grad() [1/4]

static fl::i32 grad ( fl::u8 hash,
fl::i32 x )
static

Definition at line 74 of file simplex.cpp.hpp.

74 {
75 fl::u8 h = hash & 15;
76 fl::i32 grad = 1 + (h&7); // Gradient value 1.0, 2.0, ..., 8.0
77 if ((h&8) != 0) {
78 grad = -grad; // Set a random sign for the gradient
79 }
80 return grad * x; // Multiply the gradient with the distance (integer * 0.12 = *.12)
81}
int x
Definition simple.h:92
unsigned char u8
Definition stdint.h:131
static fl::i32 grad(fl::u8 hash, fl::i32 x)

References grad(), and x.

Referenced by grad(), snoise16(), snoise16(), snoise16(), and snoise16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: