-
-
Notifications
You must be signed in to change notification settings - Fork 135
FAQ
error LNK2001: unresolved external symbol "__declspec(dllimport) private: static void __cdecl FastNoise::SmartNodeManager::DecReference...
If you are linking to the static library version of FastNoise2, you need to define FASTNOISE_STATIC_LIB in any project that links to it.
In CMake this is handled automatically by target_link_libraries. If you're linking manually in Visual Studio, add FASTNOISE_STATIC_LIB to your project's preprocessor definitions (Project Properties > C/C++ > Preprocessor > Preprocessor Definitions).
FastNoise2 uses SIMD instructions that are automatically selected at runtime based on your CPU's capabilities. Different SIMD levels (SSE2, AVX2, AVX512, etc.) can produce slightly different floating point results due to differences in instruction ordering and precision. This output difference is within floating point rounding error.
If you need exact reproducibility across different machines:
-
Build with strict floating point: Enable the
FASTNOISE2_STRICT_FPCMake option, which enforces stricter floating point behaviour. -
Lock the SIMD level: Force all nodes to use the same SIMD level:
This ensures every machine uses the same instruction set, at the cost of performance on more capable CPUs.
auto node = FastNoise::New<FastNoise::Simplex>( FastSIMD::FeatureSet::SSE2 );
Both are gradient noise algorithms, but they differ in their underlying grid structure:
- Perlin uses a regular (square/cubic) grid and samples 4 corners in 2D, 8 in 3D. It can show subtle axis-aligned artifacts.
- Simplex uses a simplex (triangular/tetrahedral) grid and samples fewer points (3 in 2D, 4 in 3D). It produces more isotropic (directionally uniform) output with fewer visible artifacts.
For most applications, the visual difference is subtle. Simplex generally looks slightly smoother and more natural. See Understanding Noise Types for a detailed comparison.
Feature Scale is the size of one noise period in world units. It's the inverse of frequency:
Feature Scale = 1.0 / Frequency
A Feature Scale of 100 means noise features span roughly 100 world units. A scale of 50 means features are half that size (twice the frequency).
Feature Scale is set on the node itself (SetScale()), while step size in the generation functions controls how densely you sample the noise. They are independent:
- Feature Scale changes the pattern
- Step size changes the resolution of your sampling grid
Use GenTileable2D() instead of GenUniformGrid2D():
auto noise = FastNoise::New<FastNoise::Simplex>();
std::vector<float> tileData( 256 * 256 );
noise->GenTileable2D( tileData.data(), 256, 256, 1.0f, 1.0f, 1337 );This maps the 2D grid onto a 4D hypertorus internally, so the output tiles seamlessly in both X and Y. The underlying noise types will be using 4D generation.
All generation methods (GenUniformGrid*, GenPositionArray*, GenSingle*, GenTileable2D) are const and fully thread-safe. You can share a single node tree across any number of threads and call generation concurrently with no synchronisation needed.
auto generator = FastNoise::New<FastNoise::Simplex>();
// Thread 1
generator->GenUniformGrid2D( buffer1, 0, 0, 256, 256, 1, 1, 1337 );
// Thread 2 (concurrent, safe)
generator->GenUniformGrid2D( buffer2, 256, 0, 256, 256, 1, 1, 1337 );Do not modify node parameters (SetSource, SetScale, etc.) while generation is running on another thread.
- GenUniformGrid - Convenient when you need a regular grid and don't want to manage position arrays yourself. Generates the uniform grid positions internally each call.
- GenPositionArray - The fastest option. Since positions are provided directly, the uniform grid positions don't need to be generated internally. For maximum performance across many generation calls, pre-generate your own uniform grid positions once and reuse them for all calls, using the offset parameters to shift the sampling region. Also works for arbitrary, non-uniform positions (mesh vertices, particle positions, scattered points).
- GenSingle - VERY SLOW. Only use if you truly need a single sample. Significantly slower per-sample than batch methods due to SIMD underutilisation. Never use in a loop; use a batch method instead.
Performance tip for 3D/4D uniform grids: Avoid setting xCount = 1 when you want a 2D slice. Due to how positions are generated internally, a small xCount is bad for performance. Use yCount = 1 or zCount = 1 instead.
Yes. FastNoise2 is built on the FastSIMD abstraction layer. You can create custom nodes using the SIMD-agnostic interface - write your code once and it automatically compiles for all supported SIMD architectures.
Custom nodes automatically work with the Node Editor, serialisation, and other language bindings thanks to the metadata system.
- Web version (no install): https://auburn.github.io/FastNoise2/
- Desktop binaries: Latest Release
-
Build from source: Enable
FASTNOISE2_TOOLS=ONwhen building with CMake