8-bit, fixed point implementation of Perlin's noise without scaling.
Coordinates are 8.8 fixed point values, 16-bit integers with integral coordinates in the high 8-bits and fractional in the low 8-bits.
- Returns
- unscaled noise value as a signed integer, roughly -70 to 70
- Parameters
-
x | x-axis coordinate on noise map (1D) |
y | y-axis coordinate on noise map (2D) |
Definition at line 624 of file noise.cpp.
625{
626
629
630
634 uint8_t B =
P(X+1)+Y;
637
638
641
642
643 int8_t xx = ((uint8_t)(
x)>>1) & 0x7F;
644 int8_t yy = ((uint8_t)(
y)>>1) & 0x7F;
645 uint8_t N = 0x80;
646
647 u = EASE8(u); v = EASE8(v);
648
651
653
654 return ans;
655
656}
static int8_t grad8(uint8_t hash, int8_t x, int8_t y, int8_t z)
#define P(x)
Reads a single byte from the p array.
static int8_t lerp7by8(int8_t a, int8_t b, fract8 frac)
References grad8(), lerp7by8(), P, x, and y.