* Helper function to hash an integer using the above permutation table * * This inline function costs around 1ns, and is called N+1 times for a noise of N dimension. * * Using a real hash function would be better to improve the "repeatability of 256" of the above permutation table, * but fast integer Hash functions uses more time and have bad random properties. * * @param[in] i Integer va
| 98 | * @return 8-bits hashed value |
| 99 | */ |
| 100 | static inline uint8_t hash(int32_t i) { |
| 101 | return perm[static_cast<uint8_t>(i)]; |
| 102 | } |
| 103 | |
| 104 | /* NOTE Gradient table to test if lookup-table are more efficient than calculs |
| 105 | static const float gradients1D[16] = { |