![]() |
naev 0.12.6
|
Handles creating noise based on perlin noise. More...
#include "perlin.h"#include "rng.h"
Go to the source code of this file.
Data Structures | |
| struct | perlin_data_t |
| Structure used for generating noise. More... | |
Macros | |
| #define | SIMPLEX_SCALE 0.5f |
| #define | SWAP(a, b, t) |
| #define | FLOOR(a) |
| #define | NOISE_SIMPLEX_GRADIENT_1D(n, h, x) |
Functions | |
| perlin_data_t * | noise_new (void) |
| Creates a new perlin noise generator. | |
| float | noise_simplex1 (perlin_data_t *pdata, float f[1]) |
| Gets 1D simplex noise for a position. | |
| void | noise_delete (perlin_data_t *pdata) |
| Frees some noise data. | |
Handles creating noise based on perlin noise.
Code tries to handle basically 2d/3d cases, without much genericness because it needs to be pretty fast. Originally sped up the code from about 20 seconds to 8 seconds per Nebula image with the manual loop unrolling.
Definition in file perlin.c.
| #define FLOOR | ( | a | ) |
| #define NOISE_SIMPLEX_GRADIENT_1D | ( | n, | |
| h, | |||
| x ) |
| #define SWAP | ( | a, | |
| b, | |||
| t ) |
| void noise_delete | ( | perlin_data_t * | pdata | ) |
| perlin_data_t * noise_new | ( | void | ) |