|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Deterministic curl-noise flow field for the particle Noise/Turbulence module — a pure-CPU, header-only vector field the sim advects particles along, exactly like gravity is a force in the same loop. No GPU path, no external tables, so it runs byte-identically on every platform (WeChat mini-game included). More...


Go to the source code of this file.
Namespaces | |
| namespace | esengine |
| namespace | esengine::particle |
| namespace | esengine::particle::noise |
Functions | |
| f32 | esengine::particle::noise::hash2 (i32 x, i32 y) |
| glm::vec2 | esengine::particle::noise::grad2 (i32 x, i32 y) |
| f32 | esengine::particle::noise::fade (f32 t) |
| f32 | esengine::particle::noise::perlin2 (glm::vec2 p) |
| f32 | esengine::particle::noise::fbm2 (glm::vec2 p, i32 octaves) |
| glm::vec2 | esengine::particle::noise::curl (glm::vec2 sample, i32 octaves) |
Deterministic curl-noise flow field for the particle Noise/Turbulence module — a pure-CPU, header-only vector field the sim advects particles along, exactly like gravity is a force in the same loop. No GPU path, no external tables, so it runs byte-identically on every platform (WeChat mini-game included).
The field is the 2D curl of a fractal-Brownian scalar potential, i.e. flow = (∂ψ/∂y, -∂ψ/∂x). A curl field is divergence-free, so particles never pile up in sinks or thin out at sources the way a raw noise vector field does — the classic "swirly but even" turbulence look.
Definition in file ParticleNoise.hpp.