Files
industrial-genesis/src/noise.h
T

13 lines
447 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef TERRAIN_NOISE_H
#define TERRAIN_NOISE_H
#include <stdint.h>
// 双线性值噪声:在整数格点取随机值,格点之间用 smoothstep 插值,输出 0–1
double value_noise(uint64_t seed, int type, double x, double y, double scale);
// 分形噪声:多个倍频叠加,输出 0–1
double fractal_noise(uint64_t seed, int type, double x, double y,
double scale, int octaves, double persistence);
#endif