[[ OpenSimplex2 ; https://github.com/KdotJPG/OpenSimplex2 ]] noise algorithm. Ported from [[ https://github.com/KdotJPG/OpenSimplex2 ]]. Copyright 2022 Yuki2 [[ https://github.com/NoahR02 ]]

Collection Info

View Source
Collection
core
Path
math/noise
Entries
12

Source Files

Types

3

Procedures

9

noise_2d #

Source
@(require_results)
noise_2d :: proc(seed: i64, coord: [2]f64) -> (value: f32) {…}

2D Simplex noise, standard lattice orientation.

noise_2d_improve_x #

Source
@(require_results)
noise_2d_improve_x :: proc(seed: i64, coord: [2]f64) -> (value: f32) {…}

2D Simplex noise, with Y pointing down the main diagonal. Might be better for a 2D sandbox style game, where Y is vertical. Probably slightly less optimal for heightmaps or continent maps, unless your map is centered around an equator. It's a subtle difference, but the option is here to make it an easy choice.

noise_3d_fallback #

Source
@(require_results)
noise_3d_fallback :: proc(seed: i64, coord: [3]f64) -> (value: f32) {…}

3D OpenSimplex2 noise, fallback rotation option Use `noise_3d_improve_xy` or `noise_3d_improve_xz` instead, wherever appropriate. They have less diagonal bias. This function's best use is as a fallback.

noise_3d_improve_xy #

Source
@(require_results)
noise_3d_improve_xy :: proc(seed: i64, coord: [3]f64) -> (value: f32) {…}

3D OpenSimplex2 noise, with better visual isotropy in (X, Y). Recommended for 3D terrain and time-varied animations. The Z coordinate should always be the "different" coordinate in whatever your use case is. If Y is vertical in world coordinates, call `noise_3d_improve_xz(x, z, Y)` or use `noise_3d_xz_before_y`. If Z is vertical in world coordinates, call `noise_3d_improve_xz(x, y, Z)`. For a time varied animation, call `noise_3d_improve_xz(x, y, T)`.

noise_3d_improve_xz #

Source
@(require_results)
noise_3d_improve_xz :: proc(seed: i64, coord: [3]f64) -> (value: f32) {…}

3D OpenSimplex2 noise, with better visual isotropy in (X, Z). Recommended for 3D terrain and time-varied animations. The Y coordinate should always be the "different" coordinate in whatever your use case is. If Y is vertical in world coordinates, call `noise_3d_improve_xz(x, Y, z)`. If Z is vertical in world coordinates, call `noise_3d_improve_xz(x, Z, y)` or use `noise_3d_improve_xy`. For a time varied animation, call `noise_3d_improve_xz(x, T, y)` or use `noise_3d_improve_xy`.

noise_4d_fallback #

Source
@(require_results)
noise_4d_fallback :: proc(seed: i64, coord: [4]f64) -> (value: f32) {…}

4D OpenSimplex2 noise, fallback lattice orientation.

noise_4d_improve_xyz #

Source
@(require_results)
noise_4d_improve_xyz :: proc(seed: i64, coord: [4]f64) -> (value: f32) {…}

4D OpenSimplex2 noise, with XYZ oriented like `noise_3d_fallback` and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) where there isn't a clear distinction between horizontal and vertical

noise_4d_improve_xyz_improve_xy #

Source
@(require_results)
noise_4d_improve_xyz_improve_xy :: proc(seed: i64, coord: [4]f64) -> (value: f32) {…}

4D OpenSimplex2 noise, with XYZ oriented like `noise_3d_improve_xy` and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) in a space where Z is vertical.

noise_4d_improve_xyz_improve_xz #

Source
@(require_results)
noise_4d_improve_xyz_improve_xz :: proc(seed: i64, coord: [4]f64) -> (value: f32) {…}

4D OpenSimplex2 noise, with XYZ oriented like `noise_3d_improve_xz` and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) in a space where Y is vertical.